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
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