PC Review


Reply
Thread Tools Rate Thread

Determining selected worksheet

 
 
Bob Conar
Guest
Posts: n/a
 
      19th Oct 2003
I am using a common userform among several worksheets. Each sheet has
a macro button that will launce this userform dialog box. If
sheet(bob) is the one the user is using, I want the userform label
caption to read: "Bob's Page". If sheet(anne) is the one the user is
using, I want the userform label caption to read: "Anne's Page". If
sheet(christy) is the one the user is using, I want the userform label
caption to read: "Christy's Page".

Actually, these sheets are named for modules at the plant. The above
are only examples. We use these sheets to capture downtime from these
areas.

I have unsuccessfully tried this VB:

If ActiveSheet = "bob" Then
lbltitle.caption = "Bob's Page"
ElseIf ActiveSheet = "anne" Then
lbltitle.caption = "Anne's Page"
ElseIf ActiveSheet = "christy" Then
lbltitle.caption = "Christy's Page"
EndIf

'This didn't work, so I tried the following:

If Sheet = "bob" Then
lbltitle.caption = "Bob's Page"

If Sheet.visible = "bob" Then
lbltitle.caption = "Bob's Page"

'Neither of these worked either.

Thank you, Bob Conar
 
Reply With Quote
 
 
 
 
Dave Peterson
Guest
Posts: n/a
 
      19th Oct 2003
lbltitle.caption = activesheet.name & "'s Page"

looks like it might work.

Bob Conar wrote:
>
> I am using a common userform among several worksheets. Each sheet has
> a macro button that will launce this userform dialog box. If
> sheet(bob) is the one the user is using, I want the userform label
> caption to read: "Bob's Page". If sheet(anne) is the one the user is
> using, I want the userform label caption to read: "Anne's Page". If
> sheet(christy) is the one the user is using, I want the userform label
> caption to read: "Christy's Page".
>
> Actually, these sheets are named for modules at the plant. The above
> are only examples. We use these sheets to capture downtime from these
> areas.
>
> I have unsuccessfully tried this VB:
>
> If ActiveSheet = "bob" Then
> lbltitle.caption = "Bob's Page"
> ElseIf ActiveSheet = "anne" Then
> lbltitle.caption = "Anne's Page"
> ElseIf ActiveSheet = "christy" Then
> lbltitle.caption = "Christy's Page"
> EndIf
>
> 'This didn't work, so I tried the following:
>
> If Sheet = "bob" Then
> lbltitle.caption = "Bob's Page"
>
> If Sheet.visible = "bob" Then
> lbltitle.caption = "Bob's Page"
>
> 'Neither of these worked either.
>
> Thank you, Bob Conar


--

Dave Peterson
(E-Mail Removed)
 
Reply With Quote
 
Tom Ogilvy
Guest
Posts: n/a
 
      19th Oct 2003
lbltitle.caption = Activesheet.Name & "'s Page"

--
Regards,
Tom Ogilvy


Bob Conar <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> I am using a common userform among several worksheets. Each sheet has
> a macro button that will launce this userform dialog box. If
> sheet(bob) is the one the user is using, I want the userform label
> caption to read: "Bob's Page". If sheet(anne) is the one the user is
> using, I want the userform label caption to read: "Anne's Page". If
> sheet(christy) is the one the user is using, I want the userform label
> caption to read: "Christy's Page".
>
> Actually, these sheets are named for modules at the plant. The above
> are only examples. We use these sheets to capture downtime from these
> areas.
>
> I have unsuccessfully tried this VB:
>
> If ActiveSheet = "bob" Then
> lbltitle.caption = "Bob's Page"
> ElseIf ActiveSheet = "anne" Then
> lbltitle.caption = "Anne's Page"
> ElseIf ActiveSheet = "christy" Then
> lbltitle.caption = "Christy's Page"
> EndIf
>
> 'This didn't work, so I tried the following:
>
> If Sheet = "bob" Then
> lbltitle.caption = "Bob's Page"
>
> If Sheet.visible = "bob" Then
> lbltitle.caption = "Bob's Page"
>
> 'Neither of these worked either.
>
> Thank you, Bob Conar



 
Reply With Quote
 
Bob Conar
Guest
Posts: n/a
 
      20th Oct 2003
Excellent! Thanks a lot.
Bob Conar

"Tom Ogilvy" <(E-Mail Removed)> wrote in message news:<(E-Mail Removed)>...
> lbltitle.caption = Activesheet.Name & "'s Page"
>
> --
> Regards,
> Tom Ogilvy
>
>
> Bob Conar <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
> > I am using a common userform among several worksheets. Each sheet has
> > a macro button that will launce this userform dialog box. If
> > sheet(bob) is the one the user is using, I want the userform label
> > caption to read: "Bob's Page". If sheet(anne) is the one the user is
> > using, I want the userform label caption to read: "Anne's Page". If
> > sheet(christy) is the one the user is using, I want the userform label
> > caption to read: "Christy's Page".
> >
> > Actually, these sheets are named for modules at the plant. The above
> > are only examples. We use these sheets to capture downtime from these
> > areas.
> >
> > I have unsuccessfully tried this VB:
> >
> > If ActiveSheet = "bob" Then
> > lbltitle.caption = "Bob's Page"
> > ElseIf ActiveSheet = "anne" Then
> > lbltitle.caption = "Anne's Page"
> > ElseIf ActiveSheet = "christy" Then
> > lbltitle.caption = "Christy's Page"
> > EndIf
> >
> > 'This didn't work, so I tried the following:
> >
> > If Sheet = "bob" Then
> > lbltitle.caption = "Bob's Page"
> >
> > If Sheet.visible = "bob" Then
> > lbltitle.caption = "Bob's Page"
> >
> > 'Neither of these worked either.
> >
> > Thank you, Bob Conar

 
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
Determining row # of selected cell =?Utf-8?B?Qm9i?= Microsoft Excel Programming 2 25th Sep 2007 12:28 PM
I have a problem with determining if a shape is selected. =?Utf-8?B?QW5keVQ=?= Microsoft Excel Programming 6 16th May 2007 06:37 PM
Determining if a chart is selected roybrew@att.net Microsoft Excel Charting 2 25th Jan 2005 03:06 PM
Determining child row selected in datagrid =?Utf-8?B?RW5naW5lZXJpaw==?= Microsoft VB .NET 0 15th Oct 2004 04:19 PM
Determining how a combo box got selected Juan Galvez Microsoft Access Form Coding 4 5th Mar 2004 02:18 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 03:57 AM.