Hello,
I am trying to create a macro that will bump data into another column/page if the data in the row ="Header" and if the "Header" tag falls on rows 61, 121, 181, etc.
I feel like I am on the right track with the formula I need to use, but just having a hard time getting past some errors.
When I use the formula
Formula:
=mod(row()-1,60
, this returns "0" at all the places I would like to insert an additional row. Therefore I tried the following, but getting "Expected an Expression" error.
Set Compileddata = Range("A1", ActiveSheet.Cells(ActiveSheet.Rows.Count, 1).End(xlUp))
CompiledrowIndex = 60 'This is number of rows on first page. Page breaks at multiples of 60
Do While CompiledrowIndex <= Compileddata.Rows.Count
If Compileddata.Cells(CompiledrowIndex, 1) = ";;Result" and Mod(row()-1,60)=0 Then
rowIndex = rowIndex + 1
Compileddata.Cells(CompiledrowIndex, 1).EntireRow.Insert
'data.Cells(rowIndex, 1).Insert shift:=xlShiftDown
CompiledrowIndex = CompiledrowIndex + 1
Compileddata = Compileddata + 1
End If
ElseIf Compileddata.Cells(CompiledrowIndex, 1) <> ";;Result" Then
CompiledrowIndex = CompiledrowIndex + 1
End If
Loop
Bookmarks