Sheet reference in VBA

G

Guest

Hi,

In a macro I use

With Sheets("sht2").Range("b1:b100").AdvancedFilter _

to select a range on a sheet.

I want to select the sheet to perform this operation on by adding the sheet
name to a cell at a different sheet.
Say in the sheet "Sht1" in cell "a1" I put the name "Sht2"

How can I adjust teh code so that it will use at the value in sheet "Sht1"
in cell "a1"?

Best regards, Gijs
 
G

Guest

Thanks it works!

Best regards,

Gijs

Chip Pearson said:
Try

With
Sheets(sheets("Sht1").range("A1").text).Range("b1:b100").AdvancedFilter
_


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com


in message
 

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