+ Reply to Thread
Results 1 to 3 of 3

VBA code works in Mac 2011, not Windows 2007?

  1. #1
    Registered User
    Join Date
    10-30-2010
    Location
    DC, USA
    MS-Off Ver
    Mac Excel 2011
    Posts
    4

    VBA code works in Mac 2011, not Windows 2007?

    Hi-

    I prefer working on a mac, so I that is where I wrote the VBA code below on MS Excel 2011 for Mac. However, when I transferred the file over to my Windows 7 computer with Excel 2007, it did not work.

    I have no idea why.

    Here is the code for the event:


    Private Sub Worksheet_Change(ByVal Target As Range)

    If Target.Cells.Count > 1 Then Exit Sub

    If Not Intersect(Target, Range("M153:M113")) Is Nothing Then

    With Target(1, -1)

    .Value = Date

    .EntireColumn.AutoFit

    End With

    End If

    If Target.Cells.Count > 1 Then Exit Sub

    If Not Intersect(Target, Range("E13:E113")) Is Nothing Then

    With Target(1, -1)

    .Value = Date

    .EntireColumn.AutoFit

    End With

    End If

    End Sub

    Essentially, the even works like this: If you enter something in column E or M then the date you made the entry is recorded respectively in column C or K. The date does not update.

    As I said, this works perfectly on 2011 for Mac, not at all for my 2007 on Windows. Moreover, I checked to see that the code was still intact on "Sheet 1", and it was.

    Any ideas?

  2. #2
    Valued Forum Contributor Charles's Avatar
    Join Date
    02-10-2004
    Location
    Biloxi
    MS-Off Ver
    Windows 7, Excel 2003,2007 & Mac2011
    Posts
    845

    Re: VBA code works in Mac 2011, not Windows 2007?

    Hi,

    Would it be possible for you to attach the workbook?
    Charles

    There are other ways to do this, this is but 1 !
    Be Sure you thank those who helped.
    IF YOU'RE SATISFIED BY ANY MEMBERS RESPONSE TO YOUR ISSUE PLEASE USE THE STAR ICON AT THE BOTTOM LEFT OF THE POST UNDER THEIR NAME.

  3. #3
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: VBA code works in Mac 2011, not Windows 2007?

    Your post does not comply with Rule 3 of our Forum RULES. Use code tags around code. Posting code without them makes your code hard to read and difficult to be copied for testing. Highlight your code and click the # at the top of your post window. For more information about these and other tags, found here
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1