Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.misc
|
|||
|
|||
macro help please
I have a macro that I'd like to limit the pages it can work on.
Sub columnremove() Dim myRng As Range Set myRng = ActiveSheet.Rows(4) 'for rows that have 0's or blanks in column A 'set myRng = activesheet.range("a:a") With myRng .Replace What:=0, Replacement:="", LookAt:=xlWhole On Error Resume Next .Cells.SpecialCells(xlCellTypeBlanks).EntireColumn .Delete On Error GoTo 0 End With End Sub If i click it, and I am on wrong page it can ruin alot of work, I have only 3 pages it can work on, Month One, Month Two and Month Three. Can this macro be made to "check" if its in one of those pages and not fire, or give an error message if it is not? Ryk |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
error when running cut & paste macro | Excel Worksheet Functions | |||
Compiling macro based on cell values | Excel Discussion (Misc queries) | |||
Search, Copy, Paste Macro in Excel | Excel Worksheet Functions | |||
Closing File Error | Excel Discussion (Misc queries) | |||
Highlight Range - wrong macro, please edit. | Excel Worksheet Functions |