View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.misc
Ryk Ryk is offline
external usenet poster
 
Posts: 36
Default 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