macro help needed

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
 
S

Steve Schapel

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top