Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default looping thru each w/sheet

Hi,

I'm looking to loop through each ws in the current workbook and, for
each w/sheet, programatically get the highest value in one of the
columns, count the number of occurrences of a cartain variable in
another column and return these values programatically so I can create
a Front Page type of thing.

I think I understand how to get the list of worksheets i'ts after that
I get stuck...I've no idea how to reference cells in a worksheet from
within vba.

also....

is it possible to run the code I create ONLY when a certain cell value
is changed on the Front PAge???

TIA

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default looping thru each w/sheet

For Each sh In Activeworkbook.Worksheets
myVar = sh.Range("A1")
myCount = Application.COUNTIF(Columns(3),"abc")
'do something with these values
Next sh

--
HTH

Bob Phillips

(remove nothere from email address if mailing direct)

wrote in message
oups.com...
Hi,

I'm looking to loop through each ws in the current workbook and, for
each w/sheet, programatically get the highest value in one of the
columns, count the number of occurrences of a cartain variable in
another column and return these values programatically so I can create
a Front Page type of thing.

I think I understand how to get the list of worksheets i'ts after that
I get stuck...I've no idea how to reference cells in a worksheet from
within vba.

also....

is it possible to run the code I create ONLY when a certain cell value
is changed on the Front PAge???

TIA



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default looping thru each w/sheet

I think Bob wanted:

myCount = Application.COUNTIF(sh.Columns(3),"abc")

(just to make sure he was using column 3 on sheet sh.)

If the cell changes because of a typing change, then you could tie into the
worksheet_change event.

If you want to read more about these kinds of events:

Chip Pearson's site:
http://www.cpearson.com/excel/events.htm

David McRitchie's site:
http://www.mvps.org/dmcritchie/excel/event.htm


Bob Phillips wrote:

For Each sh In Activeworkbook.Worksheets
myVar = sh.Range("A1")
myCount = Application.COUNTIF(Columns(3),"abc")
'do something with these values
Next sh

--
HTH

Bob Phillips

(remove nothere from email address if mailing direct)

wrote in message
oups.com...
Hi,

I'm looking to loop through each ws in the current workbook and, for
each w/sheet, programatically get the highest value in one of the
columns, count the number of occurrences of a cartain variable in
another column and return these values programatically so I can create
a Front Page type of thing.

I think I understand how to get the list of worksheets i'ts after that
I get stuck...I've no idea how to reference cells in a worksheet from
within vba.

also....

is it possible to run the code I create ONLY when a certain cell value
is changed on the Front PAge???

TIA


--

Dave Peterson
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default looping thru each w/sheet

Thanks Dave.

Bob

(remove nothere from email address if mailing direct)

"Dave Peterson" wrote in message
...
I think Bob wanted:

myCount = Application.COUNTIF(sh.Columns(3),"abc")

(just to make sure he was using column 3 on sheet sh.)

If the cell changes because of a typing change, then you could tie into

the
worksheet_change event.

If you want to read more about these kinds of events:

Chip Pearson's site:
http://www.cpearson.com/excel/events.htm

David McRitchie's site:
http://www.mvps.org/dmcritchie/excel/event.htm


Bob Phillips wrote:

For Each sh In Activeworkbook.Worksheets
myVar = sh.Range("A1")
myCount = Application.COUNTIF(Columns(3),"abc")
'do something with these values
Next sh

--
HTH

Bob Phillips

(remove nothere from email address if mailing direct)

wrote in message
oups.com...
Hi,

I'm looking to loop through each ws in the current workbook and, for
each w/sheet, programatically get the highest value in one of the
columns, count the number of occurrences of a cartain variable in
another column and return these values programatically so I can create
a Front Page type of thing.

I think I understand how to get the list of worksheets i'ts after that
I get stuck...I've no idea how to reference cells in a worksheet from
within vba.

also....

is it possible to run the code I create ONLY when a certain cell value
is changed on the Front PAge???

TIA


--

Dave Peterson



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
Looping Steve Excel Programming 2 September 9th 05 12:45 PM
Looping Through Sheet scott Excel Programming 3 January 16th 05 05:32 PM
Looping through Sheet scott Excel Programming 5 January 7th 05 05:03 PM
Looping Hannes Excel Programming 3 December 27th 04 09:03 PM
looping through selected sheet tabs Gary Adamson[_2_] Excel Programming 4 December 7th 04 01:09 PM


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