Sheet name

O

oldjay

I want to change this from the Master sheet to the active sheet

MyConstant = Application.CountA(Sheets("Master").Range("A2:I31"))
 
L

Lars-Åke Aspelin

I want to change this from the Master sheet to the active sheet

MyConstant = Application.CountA(Sheets("Master").Range("A2:I31"))


Try this:

MyConstant = Application.CountA(ActiveSheet.Range("A2:I31"))

Hope this helps/ Lars-Åke
 
R

Rob van Gelder

Replace Sheets("Master") with ActiveSheet
eg.
MyConstant = Application.CountA(activesheet.Range("A2:I31"))
 

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