Home |
Search |
Today's Posts |
#6
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi
both ways are possible but Tom's solution using a worksheet object has the following benefits (IMHO) - easier to write using an object reference - you could use this reference to store the old object and use it later in your code Also using a for ... each construct is possible. This statement will loop through all worksheets in the collection 'worksheets' and assigns the current loop value to this object variable -----Original Message----- The 2 replies to the original question brings up a couple of points about VBA programming I do not understand, hope someone can enlighten me. 1. Why dim a variable (in this case "sh") to replace Worksheets? Why not just work directly with the built in value as the second response does? 2. Once having "Dim sh as Worksheet" why is it that the statement "for each sh in Activeworkbook.Worksheets" automatically assigns sh all of the worksheets since sh has been defined as only a (one) worksheet? Thanks "Stephen <" wrote: Hi All, I need a VBA code for looping through all the worksheets and add the =today() is cell A1, except in sheet "Overview". Please help:) Stephen --- Message posted from http://www.ExcelForum.com/ . |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Loop worksheets | Excel Discussion (Misc queries) | |||
Loop worksheets | Excel Programming | |||
Loop thru files in DIR, delete worksheets & reset worksheet Name property?? | Excel Programming | |||
Renaming Worksheets with For Each Loop | Excel Programming | |||
Conditional Lookup and copy loop between worksheets | Excel Programming |