Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
The following code will run on the selected worksheet. Is there a way
to make this run on all worksheets in a workbook? The file this is to run on contains 52 worksheets in 1 workbook. Thanx!! Sub clear9s() Dim counter counter = 0 If ActiveCell.Value = "" Then Exit Sub Do Until ActiveCell.Value = "" If ActiveCell.Value = "-9999" Then ActiveCell.Value = "not available" With Selection.Font .Size = 6 End With End If ActiveCell.Offset(1, 0).Select counter = counter + 1 Loop ActiveCell.Offset(-counter, 1).Select clear9s End Sub |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
try using the
"ActiveWorkbook.Worksheets" command to run the macro for all sheets -- Message posted from http://www.ExcelForum.com |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Sub clear9s()
Dim counter counter = 0 for each sh in Worksheets sh.Activate set rng = ActiveCell Do Until ActiveCell.Value = "" If ActiveCell.Value = "-9999" Then ActiveCell.Value = "not available" With Selection.Font .Size = 6 End With End If ActiveCell.Offset(1, 0).Select counter = counter + 1 Loop rng.select Next End Sub -- Regards, Tom Ogilvy "bearie" wrote in message om... The following code will run on the selected worksheet. Is there a way to make this run on all worksheets in a workbook? The file this is to run on contains 52 worksheets in 1 workbook. Thanx!! Sub clear9s() Dim counter counter = 0 If ActiveCell.Value = "" Then Exit Sub Do Until ActiveCell.Value = "" If ActiveCell.Value = "-9999" Then ActiveCell.Value = "not available" With Selection.Font .Size = 6 End With End If ActiveCell.Offset(1, 0).Select counter = counter + 1 Loop ActiveCell.Offset(-counter, 1).Select clear9s End Sub |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Workbook sheet code delay | Excel Discussion (Misc queries) | |||
Help...Code to copy sheet from closed workbook | Excel Discussion (Misc queries) | |||
Help:Running a macro in one excel workbook from another workbook | Setting up and Configuration of Excel | |||
running code | New Users to Excel | |||
VB code needed for running newer excel version macros in older excel versions | Excel Programming |