Get ActiveSheet name in VB

G

Geoff Lambert

This must surely be one of the simplest VB questions??

I am trying to figure out how to extract the name (tab name) of the
active sheet into VB, so I can then concatenate it into a longer string
that specifies a query file.

i.e. on ActiveSheet "FRED", I want to extract the string "FRED" and then
build the string "FRED.IQY"

As it happens, I have an add-in worksheet function Sheetname() that will
produce this name for me. So I can have a cell (e.g. at C2 that already
has the string "FRED" in it

My problem is to extract this from either cell C2 or fron the name of
the ActiveSheet into a string.

There are 150 sheets in my workbook. I want the macros to be run on only
the ActiveSheet

It must be a very simple syntax and code.

But what is it?

Thanks

Geoff Lambert
 

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