LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 16
Default Macro to insert headers..need coding help

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?

 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Way to insert a footer in an entire workbook w/o altering headers Deb Excel Discussion (Misc queries) 2 April 7th 09 09:13 PM
Insert work sheet with Custom headers DHM Excel Discussion (Misc queries) 4 July 12th 07 03:24 AM
Implant macro coding into ASP coding Sam yong Excel Programming 5 September 15th 05 10:37 AM
VBA-How to insert vba code file in a project using coding rather than manual import Excel4Engineer[_2_] Excel Programming 1 February 9th 04 05:09 PM
Coding a button or hyperlink to insert a predfined row Neal Miller Excel Programming 0 December 3rd 03 10:11 PM


All times are GMT +1. The time now is 12:45 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"