Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Help with VBA code

Hi

I am a true beginner at Excel. I want to be able to iterate through
almost all worksheets, add some values as I go along, and display the
total into cells of another sheet within the same workbook.
This is the scenario. I have a workbook with x worksheets. At the click
of a button I want to be able to iterate through all worksheets except
the worksheet where the button resides.
As the program iterates through all the worksheets in the workbook, it
allots the values of a few common cells throughout each worksheet. Once
it has gone through all the worksheets (except the last one), it should
render the total for each common cell unto cells specific to each value
total.
I tried winging this on my own, by I am not good at this VBA language.
Can someone please help me with some code or point me in the direction
where I can find a good VBA reference?
I would really appreciate it.

Thanks
HS

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,391
Default Help with VBA code

HS,
It is normally a good starting point to record your actions in a macro
(ToolsMacrorecord New Macro) to give you a direction.

As a start, look into the For Each .. In. .. loop
And you would need to test each WS to see if it is of interest to you.

In your case, something like:
Dim WS as Worksheet
For Each WS In Thisworkbook
If WS.Name<Activesheet.Name Then
With WS
.Range("A1").Value=1 'Whatever the value and cell
.Range("A2").Value=2 '...
'Total the values as required
End With
End If
Next

NickHK


wrote in message
oups.com...
Hi

I am a true beginner at Excel. I want to be able to iterate through
almost all worksheets, add some values as I go along, and display the
total into cells of another sheet within the same workbook.
This is the scenario. I have a workbook with x worksheets. At the click
of a button I want to be able to iterate through all worksheets except
the worksheet where the button resides.
As the program iterates through all the worksheets in the workbook, it
allots the values of a few common cells throughout each worksheet. Once
it has gone through all the worksheets (except the last one), it should
render the total for each common cell unto cells specific to each value
total.
I tried winging this on my own, by I am not good at this VBA language.
Can someone please help me with some code or point me in the direction
where I can find a good VBA reference?
I would really appreciate it.

Thanks
HS



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
split post code (zip code) out of cell that includes full address Concord Excel Discussion (Misc queries) 4 October 15th 09 06:59 PM
Drop Down/List w/Code and Definition, only code entered when selec Spiritdancer Excel Worksheet Functions 2 November 2nd 07 03:57 AM
How to make a button VBA code reference other VBA code subroutines??? gunman[_9_] Excel Programming 4 September 27th 05 01:01 AM
stubborn Excel crash when editing code with code, one solution Brian Murphy Excel Programming 0 February 20th 05 05:56 AM
option buttons run Click code when value is changed via VBA code neonangel Excel Programming 5 July 27th 04 08:32 AM


All times are GMT +1. The time now is 01:10 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"