N
neil
hi,
I have a formula that needs to be pasted into every 5th row, only if there
is no existing formula in that target row.
I have about 30000 rows of data & 10 such spreadsheets. To hasten this task,
I wrote this code, but it is missing out pasting the formula on some rows
etc...
Sub Macro2()
Dim Count As Long
Range("B5:M5").Copy
For Count = 0 To 70 Step 5
If Range("B5").Offset(Count, 0).HasFormula Then
Count = Count + 5
Else
Range("B5").Offset(Count, 0).PasteSpecial
Paste:=xlPasteFormulas, Operation:=xlNone, _
SkipBlanks:=False, Transpose:=False
Count = Count + 5
End If
Next Count
End Sub
TIA
Neil
I have a formula that needs to be pasted into every 5th row, only if there
is no existing formula in that target row.
I have about 30000 rows of data & 10 such spreadsheets. To hasten this task,
I wrote this code, but it is missing out pasting the formula on some rows
etc...
Sub Macro2()
Dim Count As Long
Range("B5:M5").Copy
For Count = 0 To 70 Step 5
If Range("B5").Offset(Count, 0).HasFormula Then
Count = Count + 5
Else
Range("B5").Offset(Count, 0).PasteSpecial
Paste:=xlPasteFormulas, Operation:=xlNone, _
SkipBlanks:=False, Transpose:=False
Count = Count + 5
End If
Next Count
End Sub
TIA
Neil