Excel for Mac Runtime Error 1004

bayles

Board Regular
Joined
Oct 31, 2013
Messages
54
Hi All,

This piece of code is throwing an error 1004 when run on an Excel for Mac spreadsheet on the second last line where it pastes the copied cell formula. This works perfectly on Windows PC.

Any help appreciated.

thanks
Ryan


Dim Max, c, StartCol as Integer
Dim rng as Range

c = Sheets("DATA ENTRY").Cells.Find(What:="MATCHED", After:=Sheets("DATA ENTRY").Range("A1"), LookIn:=xlFormulas, LookAt _
:=xlWhole, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:= _
False).Column ' THE COLUMN OF MATCHED


Max = Sheets("CATEGORY HIERARCHY").Cells.SpecialCells(xlCellTypeLastCell).Row - 1


'INSERT HEADINGS FOR CATEGORY VALIDATION
Sheets("DATA ENTRY").Select
ActiveWindow.FreezePanes = False
Set rng = Sheets("DATA ENTRY").Cells(1, c + 1)


StartCol = rng.Column
Range(rng, rng.Offset(100000, 6 * Max)).ClearContents


With rng
.Offset(0, 1) = 1
.Offset(0, 2).FormulaR1C1 = "=RC[-1]+1"
.Offset(0, 2).Copy Range(rng.Offset(0, 2), rng.Offset(0, 5))
End With
 

Excel Facts

Format cells as date
Select range and press Ctrl+Shift+3 to format cells as date. (Shift 3 is the # sign which sort of looks like a small calendar).
mac and pc excel are different, a number of sites detail the differences
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,185
Members
453,020
Latest member
Mohamed Magdi Tawfiq Emam

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