Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
split post code (zip code) out of cell that includes full address | Excel Discussion (Misc queries) | |||
Drop Down/List w/Code and Definition, only code entered when selec | Excel Worksheet Functions | |||
How to make a button VBA code reference other VBA code subroutines??? | Excel Programming | |||
stubborn Excel crash when editing code with code, one solution | Excel Programming | |||
option buttons run Click code when value is changed via VBA code | Excel Programming |