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: 1
Default an array to step through sheets

I only write VBA once in a blue moon and so I am probably asking the obvious

I want to use a list of sheetnames (that will grow over time) held in the "companies" sheet ,cells b1 to b?? to pass control to a routine that selects each sheet in turn, carries out some code and then selects the next sheet...

Obviously I can do this using a routine to find the row of the last name in column B and then a LOOP

Sub WSheetSelectL(

' selects each sheet name down the list & activates that shee
Sheets("companies").Selec
Range("b1").Offset(1, 0).Selec
Do While Not IsEmpty(ActiveCell
Nrow = (ActiveCell.Row
Sname$ = Cells(Nrow, 2
' passes the sheet name to a routine that executes more code on the named shee
Sheets("companies").Selec
ActiveCell.Offset(1, 0).Selec
Loo

End Sub

However, I am sure that I could use an array and be a lot neater/efficient. Trying this has brought me to the limit of my knowledge, I can populate the array from the cells, but can I use it? Can I h**l

CAN ANYONE SUGGEST A WAY

 
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
Creating a Drop Down List with Step by Step Instructions for 2007 remarkable Excel Worksheet Functions 2 March 22nd 09 04:36 AM
Need step by step to add invoice numbering to excel template rmt New Users to Excel 4 July 6th 08 11:45 PM
Can anyone povide step by step instructions on how to do the follo Daniel Bunt Excel Discussion (Misc queries) 6 January 26th 07 12:58 PM
What is the step-by-step procedure for making a data list? Bobgolfs56 Excel Discussion (Misc queries) 1 April 23rd 05 02:19 PM
I need step by step instructions to create a macro for 10 imbedde. diana Excel Worksheet Functions 3 January 31st 05 01:56 AM


All times are GMT +1. The time now is 09:43 PM.

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

About Us

"It's about Microsoft Excel"