ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   selecting worksheets (https://www.excelbanter.com/excel-programming/307135-selecting-worksheets.html)

Matthew Kramer

selecting worksheets
 
I have an excel workbook and I'd like to run a procedure on all the
worksheets in the workbook, unless it is a worksheet called
"description" or "data". If it is one of these two worksheets, then the
program need do nothing. But if it is not one of these worksheets, then
the programme should run the procedure. What would be the right VB code
to do this?

On a separate note, I also have an excel worksheet called "filter" with
contains data info to run an advanced filter to extract from a larger
dataset. The data set with the info to run an advanced filter, for
example, is:

firstname lastname indexno.
Larry Reeves 77642
Mary Adams 98789
Nancy Hopper 76543

I'd like to use the above dataset to extract the full line of info from
the complete dataset which is on another worksheet called "full data" in
the workbook.

The complete data set in the "full data" worksheet is, for example:

firstname lastname indexno. address birthday
Larry Reeves 77642 40 Mohawk 1/19/70
Mary Adams 98789 10 Brook Lane 6/3/64
Nancy Hopper 76543 82 Farm Hill 4/22/73
(There'd also be a lot of other names and info in this data set, but I
would like to extract just the ones specified in the first smaller
dataset created to do the advanced filter)

How could I write the VB code to do this?

Thanks.

Matthew Kramer




*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

Frank Kabel

selecting worksheets
 
Hi
for the first question try something like
sub foo()
dim wks as worksheet
for each wks in worksheets
if lcase(wks.name)<"description" and _
lcase(wks.name)<"data" then
'your code
end if
next
end sub

--
Regards
Frank Kabel
Frankfurt, Germany

"Matthew Kramer" schrieb im Newsbeitrag
...
I have an excel workbook and I'd like to run a procedure on all the
worksheets in the workbook, unless it is a worksheet called
"description" or "data". If it is one of these two worksheets, then

the
program need do nothing. But if it is not one of these worksheets,

then
the programme should run the procedure. What would be the right VB

code
to do this?

On a separate note, I also have an excel worksheet called "filter"

with
contains data info to run an advanced filter to extract from a larger
dataset. The data set with the info to run an advanced filter, for
example, is:

firstname lastname indexno.
Larry Reeves 77642
Mary Adams 98789
Nancy Hopper 76543

I'd like to use the above dataset to extract the full line of info

from
the complete dataset which is on another worksheet called "full data"

in
the workbook.

The complete data set in the "full data" worksheet is, for example:

firstname lastname indexno. address birthday
Larry Reeves 77642 40 Mohawk 1/19/70
Mary Adams 98789 10 Brook Lane 6/3/64
Nancy Hopper 76543 82 Farm Hill 4/22/73
(There'd also be a lot of other names and info in this data set, but

I
would like to extract just the ones specified in the first smaller
dataset created to do the advanced filter)

How could I write the VB code to do this?

Thanks.

Matthew Kramer




*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!




All times are GMT +1. The time now is 04:15 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com