macro help needed

  • Thread starter Thread starter Ryk
  • Start date Start date
R

Ryk

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?

Ryk
 
Ryk,

The focus of this newsgroup is macros in Access, the database program.
It appears your question is about Excel, and you would have a better
chance of getting good help in an Excel-related newsgroup.
 
Back
Top