Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 18
Default 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!
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,885
Default 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!


Reply
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
VBA question about selecting worksheets jlclyde Excel Discussion (Misc queries) 3 April 17th 08 04:39 PM
selecting cells in different worksheets Kaitlin.uk Excel Discussion (Misc queries) 2 January 17th 07 04:46 PM
Selecting and summing across worksheets JMS Excel Discussion (Misc queries) 2 July 15th 05 01:06 AM
Selecting across worksheets JMS Excel Discussion (Misc queries) 1 July 14th 05 10:44 PM
Selecting worksheets without hardcoding jeff Excel Programming 0 May 4th 04 08:45 PM


All times are GMT +1. The time now is 11:53 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"