Macros from PC to edit to work in Mac

Kazdima

Board Regular
Joined
Oct 15, 2010
Messages
226
Hello all,
i have a Macro prepared in Excel 2013 for PC and need help to edit it to work in Mac.
I would appreciate anyone's help.
i made Bold the part which does not work.

Thank you.
====================================================================================
Sub Edit_New_Data()
Dim lastRow As Long

Application.ScreenUpdating = False
Application.CutCopyMode = False

With Sheets("Edit File")
.Columns("F:F").Insert Shift:=xlToRight, CopyOrigin:=xlFormatFromLeftOrAbove

'Copy over data
Sheets("M_1").Range("B1:L1").Copy .Range("A1")
'Fill in formula
lastRow = .Cells(.Rows.Count, "E").End(xlUp).Row
.Range("F2:F" & lastRow).FormulaR1C1 = "=RC[-2]&RC[-1]"

.Columns("G:G").Replace What:=".", Replacement:="/", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False


'Adjust formatting
With .Cells.Font
.Name = "Arial"
.Size = 8
.Strikethrough = False
.Superscript = False
.Subscript = False
.OutlineFont = False
.Shadow = False
.Underline = xlUnderlineStyleNone
.ColorIndex = xlAutomatic
.TintAndShade = 0
.ThemeFont = xlThemeFontNone
End With
Application.Goto .Range("A1")
End With
Application.ScreenUpdating = True
End Sub
 

Excel Facts

Enter current date or time
Ctrl+: enters current time. Ctrl+; enters current date. Use Ctrl+: Ctrl+; Enter for current date & time.
The SearchFormat and ReplaceFormat arguments are not supported in Excel 2011 for Mac.

Removing those arguments should make it run.
 
Upvote 0
I want to reformat dates (text format) like this
2010.11.08

<tbody>
</tbody>
in Column G:G which I run from a data base. How can I reformat them By Macro into 08/11/2010?
Or you are suggesting that I have to do it only manually and delete that Bold part?
Thank you.
 
Upvote 0
Replace that line with
Code:
.Columns("G:G").Replace What:=".", Replacement:="/", LookAt:=xlPart, SearchOrder:=xlByRows, MatchCase:=False
removing the two unsupported arguments.

Note, this is not a Mac/Windows issue per se, the SearchFormat argument was absent from Windows Excel VBA before 2013, its more an issue of age rather than platform.
 
Upvote 0
Thank you very much, mikerickson. I tried in PC, it is working. It did not notice a missing part-:) Now I have to try in Mac-:))
 
Upvote 0

Forum statistics

Threads
1,214,630
Messages
6,120,634
Members
448,973
Latest member
ChristineC

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top