1. Computer problem? Tech Support Guy is completely free -- paid for by advertisers and donations. Click here to join today! If you're new to Tech Support Guy, we highly recommend that you visit our Guide for New Members.

Solved: Compatibility prob. excel 2011 mac using VBA macros

Discussion in 'Business Applications' started by tomk7, Jan 22, 2011.

Thread Status:
Not open for further replies.
Advertisement
  1. tomk7

    tomk7 Thread Starter

    Joined:
    Jan 22, 2011
    Messages:
    4
    Hi,
    I have been using these forums for a while, however haven't bothered creating an account until now.

    I have had some trouble with an excel document I created in office 2010 on PC.
    When i tried it in office 2011, the program freezes as soon as a certain script is triggered.

    It may be that i am using an activX feature, however, I do not know how to tell.

    The basic part that doesnt work on mac is:

    Code:
    Private Sub Worksheet_SelectionChange(ByVal Target As Range)
    
    
    If Application.Intersect(Target, Range("B5").CurrentRegion) Is Nothing Then Exit Sub  ' Limits range to B column AND existing customers
    
    EditAccount.Show
    
    
    End Sub
    
    
    If you can help me out I would be very appreciative. :)

    Cheers,
    Tom.
     
  2. tomk7

    tomk7 Thread Starter

    Joined:
    Jan 22, 2011
    Messages:
    4
    Got it working.
    I think using .CurrentRegion is the problem on excel for mac 2011, I got around it using the following code:
    Code:
    Dim myRange As Range
    
    Set myRange = Range(Range("B5"), Range("C" & Rows.Count).End(xlUp))  ' This does a similar thing as CurrentRegion, except only in the B and C columns.
    
    If Application.Intersect(Target, myRange) Is Nothing Then Exit Sub
    
    EditAccount.Show
    End If
    
    myRange = Nothing
    
    I'm a bit disappointed I have received no help here... Anyway, I hope this helps someone else who encounters this problem.
     
  3. levy8450

    levy8450

    Joined:
    Feb 4, 2011
    Messages:
    1
    Just saw your post. On my Mac, if I use the command

    Private Sub Worksheet_SelectionChange(ByVal Target As Range)

    Excel crashes when it executes. Did you have that problem?
     
  4. tomk7

    tomk7 Thread Starter

    Joined:
    Jan 22, 2011
    Messages:
    4
    No this command is working for me, it was just the .CurrentRegion that i had to change.
    If you post more code and i might be able to help.
     
  5. sahari

    sahari

    Joined:
    Mar 9, 2011
    Messages:
    3
    hello every one,

    i would like to ask for help,

    i already made a macro for mac excel 2011, the macro is only move and copy an active worksheet to the last position of sheets.

    however, i found something wierd, suddenly there is code inside the new sheet module. the code is

    'True
    End

    this code makes me un able to run macro anymore, but after i remove that code, i can run again the macro.

    could any one help me regarding this problem?

    Thankss...
     
  6. Sponsor

As Seen On
As Seen On...

Welcome to Tech Support Guy!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

Join over 733,556 other people just like you!

Loading...
Thread Status:
Not open for further replies.

Short URL to this thread: https://techguy.org/976196

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice