Macro Run Time Error '1004' Works Properly on PC but not on Mac?

millera2340

New Member
Joined
Aug 10, 2017
Messages
2
Continually getting Run Time Error when attempting to run macro on Excel for Mac...yellow highlighted seems to be issue...

Any suggestions?

' To get dates in mm.dd Format
Range("B3:M3").Select
Selection.Copy
Range("B" & DateRow).Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False
Selection.NumberFormat = "m/d/yyyy"
Selection.Replace What:="/", Replacement:=".", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False

Range("P" & DateRow) = 8
Range("Q" & DateRow) = 3
Range("P" & DateRow + 1) = 9
Range("Q" & DateRow + 1) = 4
Range("P" & DateRow + 2) = 10
Range("Q" & DateRow + 2) = 5


Range("B" & DateRow + 1).Activate
ActiveCell.FormulaR1C1 = _
"=LEFT(R[-1]C,VLOOKUP(LEN(R[-1]C),R[-1]C16:R[1]C17,2,FALSE))"
ActiveCell.AutoFill Destination:=Range("B" & DateRow + 1 & ":M" & DateRow + 1), Type:=xlFillDefault

Range("B" & DateRow + 1 & ":M" & DateRow + 1).Copy
Range("B" & DateRow + 1).Activate
ActiveCell.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False

Range("B" & DateRow + 2) = Range("C" & DateRow + 1)
Range("B" & DateRow + 3) = Range("D" & DateRow + 1)
Range("B" & DateRow + 4) = Range("E" & DateRow + 1)
Range("B" & DateRow + 5) = Range("F" & DateRow + 1)
Range("B" & DateRow + 6) = Range("G" & DateRow + 1)
Range("B" & DateRow + 7) = Range("H" & DateRow + 1)
Range("B" & DateRow + 8) = Range("I" & DateRow + 1)
Range("B" & DateRow + 9) = Range("J" & DateRow + 1)
Range("B" & DateRow + 10) = Range("K" & DateRow + 1)
Range("B" & DateRow + 11) = Range("L" & DateRow + 1)
Range("B" & DateRow + 12) = Range("M" & DateRow + 1)
 

Excel Facts

Convert text numbers to real numbers
Select a column containing text numbers. Press Alt+D E F to quickly convert text to numbers. Faster than "Convert to Number"
Problem here:

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

SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
 
Upvote 0

Forum statistics

Threads
1,216,172
Messages
6,129,290
Members
449,498
Latest member
Lee_ray

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