M
MaryLindholm
Hi. I have some very large spread sheets that I need to insert headers
into. I figure I can do an If...then statement but I'm not getting it
to work. Here is what I have:
Sub Headers()
Dim Counter As Double
Counter = 1
If Cells(Counter, 1) = "01" Then
Cells.Insert shift:=xlDown
'do the splitting here, like
Cells(Counter, 1).FormulaR1C1 = "Record Type"
Cells(Counter, 2).FormulaR1C1 = "Process Date/Time"
Cells(Counter, 3).FormulaR1C1 = "Customer Number"
Cells(Counter, 4).FormulaR1C1 = "Customer Name"
Cells(Counter, 5).FormulaR1C1 = "Enrollment Type"
Cells(Counter, 6).FormulaR1C1 = "Filler"
End If
'Increment the Counter By 1
Counter = Counter + 1
End Sub
So every time the first cell has an 01 in it I want to insert a row
that has the header titles in it. However, when I run this macro
nothing happens. I'm not sure what I am missing. Can you help?
into. I figure I can do an If...then statement but I'm not getting it
to work. Here is what I have:
Sub Headers()
Dim Counter As Double
Counter = 1
If Cells(Counter, 1) = "01" Then
Cells.Insert shift:=xlDown
'do the splitting here, like
Cells(Counter, 1).FormulaR1C1 = "Record Type"
Cells(Counter, 2).FormulaR1C1 = "Process Date/Time"
Cells(Counter, 3).FormulaR1C1 = "Customer Number"
Cells(Counter, 4).FormulaR1C1 = "Customer Name"
Cells(Counter, 5).FormulaR1C1 = "Enrollment Type"
Cells(Counter, 6).FormulaR1C1 = "Filler"
End If
'Increment the Counter By 1
Counter = Counter + 1
End Sub
So every time the first cell has an 01 in it I want to insert a row
that has the header titles in it. However, when I run this macro
nothing happens. I'm not sure what I am missing. Can you help?