Home |
Search |
Today's Posts |
#9
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Mary,
Do the cells that are to act as triggers to insert the header contain text (i.e., "02")? If so then change the test from if cells(counter,1)=2 to if cells(counter,1)="02" Also, is the intent to process one worksheet at a time? or one workbook with more than one worksheet and process all of the worksheets within the one workbook? If processing all worksheets within one workbook, you need to loop through all worksheets making each worksheet active in turn then run the test for the "01" and "02" as Cells only works on the active worksheet. The following is an excerpt from Excel 2000 help for the Cells property: "Using this property without an object qualifier returns a Range object that represents all the cells on the active worksheet." You might consider something like For Each ws In ActiveWorkbook.Worksheets If ws.Cells(counter, 1) = "02" Then AddHeader2 Next HTH, Art |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Way to insert a footer in an entire workbook w/o altering headers | Excel Discussion (Misc queries) | |||
Insert work sheet with Custom headers | Excel Discussion (Misc queries) | |||
Implant macro coding into ASP coding | Excel Programming | |||
VBA-How to insert vba code file in a project using coding rather than manual import | Excel Programming | |||
Coding a button or hyperlink to insert a predfined row | Excel Programming |