B
brian.jermain
I have a workbook with a number of sheets all individually named.
I am trying to loop through most of them in VBA by using something
along the lines of:-
for a=5 to 16
sheet(a).select
rest of code
Next
My problem stems from the fact that I have no idea how the sheet
numbering system used in VBA relates to the sheet numbers in the
workbook or the order they are displayed in the workbook. I have three
or four sheets that I wish to exclude as the information required is
collated on these sheets and I am constantly adding and removing sheets
as projects are completed. It would probably suit me if the "static"
sheets could remain sheet 1 to sheet 4 and then loop round sheet 5 to
the end
My question is how do I know at any one time which sheets to loop
through - as I have already said they are named but I am having
difficulty identifying the sheet numbers at any particular time
Sorry if I am not making myself clear - it really should be a simple
problem but I cannot get to the bottom of it
Brian
Scotland
I am trying to loop through most of them in VBA by using something
along the lines of:-
for a=5 to 16
sheet(a).select
rest of code
Next
My problem stems from the fact that I have no idea how the sheet
numbering system used in VBA relates to the sheet numbers in the
workbook or the order they are displayed in the workbook. I have three
or four sheets that I wish to exclude as the information required is
collated on these sheets and I am constantly adding and removing sheets
as projects are completed. It would probably suit me if the "static"
sheets could remain sheet 1 to sheet 4 and then loop round sheet 5 to
the end
My question is how do I know at any one time which sheets to loop
through - as I have already said they are named but I am having
difficulty identifying the sheet numbers at any particular time
Sorry if I am not making myself clear - it really should be a simple
problem but I cannot get to the bottom of it
Brian
Scotland