Home |
Search |
Today's Posts |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
By pages, do you mean printed pages or are you referring to worksheets.
There can be many pages on a single worksheet. The worksheets are contained in a workbook. For printed pages on Sheets(1). Sub ei() Sheets(1).PrintPreview x = Sheets(1).HPageBreaks.Count + 1 MsgBox x End Sub For the number of sheets in a workbook Sub dk() y = ActiveWorkbook.Sheets.Count MsgBox y End Sub "speedy" wrote: I am looking to create a simple macro. I have created some range names, example is page1 all the way to page10. I want to copy these ranges to another worksheet. The problem is my macro is only good if I know how many range pages that I will actually need. I want to know how I can create a loop that will work for 1 page or 100 pages. -- Mr Speedy |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Reference Range Names in Macro | Excel Discussion (Misc queries) | |||
Macro and range names | Excel Programming | |||
Using range names in a macro formula | Excel Programming | |||
Macro for Range Names | Excel Programming |