Capturing current Worksheet Name as a variable

  • Thread starter Thread starter Jimbob
  • Start date Start date
J

Jimbob

I have a workbook with several sheets for different types of client. I need
to capture the client type from the sheet name but how to do this with VBA is
a mystery.

Any support gratefuly received.
Many Thanks
 
Public Sub ws_name()
Dim s As String
s = ActiveSheet.Name
MsgBox s
End Sub
 

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

Back
Top