PC Review


Reply
Thread Tools Rate Thread

Capturing current Worksheet Name as a variable

 
 
Jimbob
Guest
Posts: n/a
 
      4th Apr 2008
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
 
Reply With Quote
 
 
 
 
Jim Thomlinson
Guest
Posts: n/a
 
      4th Apr 2008
Try this...

sub test()
msgbox activesheet.name
end sub
--
HTH...

Jim Thomlinson


"Jimbob" wrote:

> 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

 
Reply With Quote
 
Jason Lepack
Guest
Posts: n/a
 
      4th Apr 2008
Public Sub ws_name()
Dim s As String
s = ActiveSheet.Name
MsgBox s
End Sub



On Apr 4, 3:03 pm, Jimbob <Jim...@discussions.microsoft.com> wrote:
> 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


 
Reply With Quote
 
Jimbob
Guest
Posts: n/a
 
      4th Apr 2008
Jason and Jim
You guys are amazing - and so quick

Thank you


"Jason Lepack" wrote:

> Public Sub ws_name()
> Dim s As String
> s = ActiveSheet.Name
> MsgBox s
> End Sub
>
>
>
> On Apr 4, 3:03 pm, Jimbob <Jim...@discussions.microsoft.com> wrote:
> > 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

>
>

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
MACRO to save current worksheet with variable filename Wes_A Microsoft Excel Programming 1 16th Sep 2009 07:43 AM
Capturing Global variable values Larry06Green Microsoft Access VBA Modules 0 13th May 2008 04:10 PM
capturing current range of cells lwm Microsoft Excel Programming 2 28th Jan 2008 03:52 AM
Capturing from variable sources =?Utf-8?B?Q1c=?= Microsoft Access Forms 3 6th Nov 2006 06:53 PM
Capturing current folder path =?Utf-8?B?REtT?= Microsoft Excel Programming 2 14th Aug 2006 11:34 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 10:06 PM.