View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Don Guillett Don Guillett is offline
external usenet poster
 
Posts: 10,124
Default Bypassing Worksheets when scanning worksheets for data

try

for each ws in worksheets
if ws.name<"Main" or ws.name <"Report" then
do your stuff
next ws.
--
Don Guillett
SalesAid Software

"Jig Bhakta" wrote in message
...
Hi have a workbook with 5 worksheets. The first one is 'Main', the Second
is
'Report' and the 3-5 are 'ABC', '123', 'POG'.

I want to write VBA code that looks at all spreadsheets in the workbook
except 'Main' and 'Report' and then copy data from cell A2 and B5:B10 from
each of these worksheets (data is in the same location for each worksheet)
into the 'Report' worksheet's cell A1 through to G1 (for the sheet 'ABC'),
A2
through to G2 (for the sheet '123'), A3 through to G3 (for the sheet
'POG'),
etc...

How can I do this?

Thanks.