Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]() Hi All: I have an Excel 2000 spk3 workbook which has about 270 identically formatted worksheets in it. I have a simple macro that clears some cells and I need to run it from worksheet 11 all the way thru worksheet 270. I need to automate it so I don't have to go to every worksheet, run the macro and go to the next and run it and so forth. Any suggestions would be welcome. ![]() -- halem2 ------------------------------------------------------------------------ halem2's Profile: http://www.excelforum.com/member.php...fo&userid=9930 View this thread: http://www.excelforum.com/showthread...hreadid=525787 |
#2
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
Sub abc()
For Each sht In ActiveWorkbook.Worksheets sht.Activate Range("A1").Value = 999 Next sht End Sub Sub cde() For Each sht In ActiveWorkbook.Worksheets sht.Range("A1").Value = 999 Next sht End Sub First way activates each sheet and second doesn't. Note that the second explicity references each sheet -- Regards Ken....................... Microsoft MVP - Excel Sys Spec - Win XP Pro / XL 97/00/02/03 ------------------------------*------------------------------*---------------- It's easier to beg forgiveness than ask permission :-) ------------------------------*------------------------------*---------------- "halem2" wrote in message ... Hi All: I have an Excel 2000 spk3 workbook which has about 270 identically formatted worksheets in it. I have a simple macro that clears some cells and I need to run it from worksheet 11 all the way thru worksheet 270. I need to automate it so I don't have to go to every worksheet, run the macro and go to the next and run it and so forth. Any suggestions would be welcome. ![]() -- halem2 ------------------------------------------------------------------------ halem2's Profile: http://www.excelforum.com/member.php...fo&userid=9930 View this thread: http://www.excelforum.com/showthread...hreadid=525787 |
#3
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]() Thanks Ken. this is how I got it to work. Sub UpdateAll() Dim sh As Worksheet Dim wb As Workbook Set wb = ActiveWorkbook ' For Each sh In ActiveWorkbook.Worksheets sh.Activate UPDATE Next Sheets("710").Select End Sub thanks a lot. -- halem2 ------------------------------------------------------------------------ halem2's Profile: http://www.excelforum.com/member.php...fo&userid=9930 View this thread: http://www.excelforum.com/showthread...hreadid=525787 |
#4
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
You're welcome :-)
Regards Ken.............. "halem2" wrote in message ... Thanks Ken. this is how I got it to work. Sub UpdateAll() Dim sh As Worksheet Dim wb As Workbook Set wb = ActiveWorkbook ' For Each sh In ActiveWorkbook.Worksheets sh.Activate UPDATE Next Sheets("710").Select End Sub thanks a lot. -- halem2 ------------------------------------------------------------------------ halem2's Profile: http://www.excelforum.com/member.php...fo&userid=9930 View this thread: http://www.excelforum.com/showthread...hreadid=525787 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Protecting all worksheets of a workbook | Excel Discussion (Misc queries) | |||
Macro pulling data from 2 worksheets | Excel Discussion (Misc queries) | |||
checking that cells have a value before the workbook will close | Excel Worksheet Functions | |||
run macro on workbook close | Excel Discussion (Misc queries) | |||
Running a macro for all visible worksheets in a workbook | Excel Discussion (Misc queries) |