macro from excel on pc does not work on mac

Hi everyone

I have a macro that does not work when ported from a windows version of excel to a mac version of excel.

The error displayed is code 1004 - Application-defined or object-defined error

My macro is simple - looks like this:

Sub Macro12()

'

' Macro12 Macro

'

'

    Sheets("Formatted").Select

    Columns("A:E").Select

    Selection.ClearContents

    Range("A1").Select

    Sheets("Time Stamps").Select

    Columns("A:A").Select

    Selection.Copy

    Sheets("Formatted").Select

    Columns("A:A").Select

    ActiveSheet.Paste

    Selection.Replace What:=" ", Replacement:="", LookAt:=xlPart, _

        SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _

        ReplaceFormat:=False

    Selection.Replace What:="Endoffile.", Replacement:="", LookAt:=xlPart, _

        SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _

        ReplaceFormat:=False

    Application.CutCopyMode = False

    Selection.TextToColumns Destination:=Range("A1"), DataType:=xlDelimited, _

        TextQualifier:=xlDoubleQuote, ConsecutiveDelimiter:=False, Tab:=True, _

        Semicolon:=False, Comma:=True, Space:=False, Other:=False, FieldInfo _

        :=Array(Array(1, 1), Array(2, 1)), TrailingMinusNumbers:=True

    Range("A1").Select

    Sheets("Graph").Select

    ActiveSheet.PivotTables("PivotTable1").PivotCache.Refresh

End Sub

June 9th, 2015 7:51am

Please provide more information. What version did you use to write the code?

What version of Mac Office is this going to run on?

What line does the error occur on? There are some differences between Mac and Windows VBA. Mac sometimes does not have all parameters.  Identify the offending line of code and check its syntax for Ma

Free Windows Admin Tool Kit Click here and download it now
June 9th, 2015 4:50pm

Hi,

We support Office for Windows in the current forum, since this question is about Office for Mac, I suggest you post the question in Office for Mac forum:

http://answers.microsoft.com/en-us/mac/forum/macoffice2011?tab=Threads

Thanks for your understanding.

Regards,

George Zhao
TechNet Community Support

June 9th, 2015 10:11pm

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics