PC Review


Reply
Thread Tools Rate Thread

codename and cell selection

 
 
ll
Guest
Posts: n/a
 
      7th May 2007
Hi,
I am needing help in the use of sheet codename in VBA. Currently,
I've successfully assigned the sheet codename to a string variable and
have tested it with a msgbox. I get error messages when the code gets
'below' the msgbox line (into the cell selection area.
Does anyone know what the proper syntax is for selecting all cells in
a sheet (referring to the sheet with its codename, rather than its
worksheet (tab) name)?
Thanks for your help,
Louis
----------

'\\\\CodeNameString = LCase(wks.CodeName)
CodeNameString = wks.CodeName

Response = MsgBox(CodeNameString, vbYesNoCancel + vbCritical +
vbDefaultButton2)

If CodeNameString = "Sheet1" Then
'\\\\LOldWb.Sheets(CodeNameString).Visible = True
'\\\\LOldWb.Sheets(CodeNameString).Select

LOldWb.Sheets(CodeNameString).Cells.Select

 
Reply With Quote
 
 
 
 
=?Utf-8?B?SmltIFRob21saW5zb24=?=
Guest
Posts: n/a
 
      7th May 2007
Since you have a sheet object use that...

'\\\\CodeNameString = LCase(wks.CodeName)
CodeNameString = wks.CodeName

Response = MsgBox(CodeNameString, vbYesNoCancel + vbCritical +
vbDefaultButton2)

If CodeNameString = "Sheet1" Then
'\\\\LOldWb.Sheets(CodeNameString).Visible = True
'\\\\LOldWb.Sheets(CodeNameString).Select

LOldWb.Activate
wks.CodeName.Cells.Select

--
HTH...

Jim Thomlinson


"ll" wrote:

> Hi,
> I am needing help in the use of sheet codename in VBA. Currently,
> I've successfully assigned the sheet codename to a string variable and
> have tested it with a msgbox. I get error messages when the code gets
> 'below' the msgbox line (into the cell selection area.
> Does anyone know what the proper syntax is for selecting all cells in
> a sheet (referring to the sheet with its codename, rather than its
> worksheet (tab) name)?
> Thanks for your help,
> Louis
> ----------
>
> '\\\\CodeNameString = LCase(wks.CodeName)
> CodeNameString = wks.CodeName
>
> Response = MsgBox(CodeNameString, vbYesNoCancel + vbCritical +
> vbDefaultButton2)
>
> If CodeNameString = "Sheet1" Then
> '\\\\LOldWb.Sheets(CodeNameString).Visible = True
> '\\\\LOldWb.Sheets(CodeNameString).Select
>
> LOldWb.Sheets(CodeNameString).Cells.Select
>
>

 
Reply With Quote
 
ll
Guest
Posts: n/a
 
      7th May 2007
Thanks - I've altered my code to that below but I get the "Invalid
Qualifier" error.

-----

CodeNameString = wks.CodeName

Response = MsgBox(CodeNameString, vbYesNoCancel + vbCritical +
vbDefaultButton2)
'Msg = CodeNameString
'MsgBox = (Msg)


If CodeNameString = "Sheet1" Then

LOldWb.Activate
wks.CodeName.Cells.Select

 
Reply With Quote
 
=?Utf-8?B?SmltIFRob21saW5zb24=?=
Guest
Posts: n/a
 
      7th May 2007
Sorry... I put in an extra dot...

CodeNameString = wks.CodeName

Response = MsgBox(CodeNameString, vbYesNoCancel + vbCritical +
vbDefaultButton2)
'Msg = CodeNameString
'MsgBox = (Msg)


If CodeNameString = "Sheet1" Then

LOldWb.Activate
wksCodeName.Cells.Select
--
HTH...

Jim Thomlinson


"ll" wrote:

> Thanks - I've altered my code to that below but I get the "Invalid
> Qualifier" error.
>
> -----
>
> CodeNameString = wks.CodeName
>
> Response = MsgBox(CodeNameString, vbYesNoCancel + vbCritical +
> vbDefaultButton2)
> 'Msg = CodeNameString
> 'MsgBox = (Msg)
>
>
> If CodeNameString = "Sheet1" Then
>
> LOldWb.Activate
> wks.CodeName.Cells.Select
>
>

 
Reply With Quote
 
ll
Guest
Posts: n/a
 
      11th May 2007
On May 7, 1:22 pm, Jim Thomlinson <James_Thomlin...@owfg-Re-Move-
This-.com> wrote:
> Sorry... I put in an extra dot...
>
> CodeNameString = wks.CodeName
>
> Response = MsgBox(CodeNameString, vbYesNoCancel + vbCritical +
> vbDefaultButton2)
> 'Msg = CodeNameString
> 'MsgBox = (Msg)
>
> If CodeNameString = "Sheet1" Then
>
> LOldWb.Activate

I> wksCodeName.Cells.Select
> --
> HTH...
>
> Jim Thomlinson
>
> "ll" wrote:
> > Thanks - I've altered my code to that below but I get the "Invalid
> > Qualifier" error.

>
> > -----

>
> > CodeNameString = wks.CodeName

>
> > Response = MsgBox(CodeNameString, vbYesNoCancel + vbCritical +
> > vbDefaultButton2)
> > 'Msg = CodeNameString
> > 'MsgBox = (Msg)

>
> > If CodeNameString = "Sheet1" Then

>
> > LOldWb.Activate
> > wks.CodeName.Cells.Select



Thanks
I've removed that extra dot, but now it is giving me an 'object
required' error message.

 
Reply With Quote
 
Bob Phillips
Guest
Posts: n/a
 
      11th May 2007
Maybe

wksCodeName.Cells.Select

should be

wks.Cells.Select


--
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)

"ll" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> On May 7, 1:22 pm, Jim Thomlinson <James_Thomlin...@owfg-Re-Move-
> This-.com> wrote:
>> Sorry... I put in an extra dot...
>>
>> CodeNameString = wks.CodeName
>>
>> Response = MsgBox(CodeNameString, vbYesNoCancel + vbCritical +
>> vbDefaultButton2)
>> 'Msg = CodeNameString
>> 'MsgBox = (Msg)
>>
>> If CodeNameString = "Sheet1" Then
>>
>> LOldWb.Activate

> I> wksCodeName.Cells.Select
>> --
>> HTH...
>>
>> Jim Thomlinson
>>
>> "ll" wrote:
>> > Thanks - I've altered my code to that below but I get the "Invalid
>> > Qualifier" error.

>>
>> > -----

>>
>> > CodeNameString = wks.CodeName

>>
>> > Response = MsgBox(CodeNameString, vbYesNoCancel + vbCritical +
>> > vbDefaultButton2)
>> > 'Msg = CodeNameString
>> > 'MsgBox = (Msg)

>>
>> > If CodeNameString = "Sheet1" Then

>>
>> > LOldWb.Activate
>> > wks.CodeName.Cells.Select

>
>
> Thanks
> I've removed that extra dot, but now it is giving me an 'object
> required' error message.
>



 
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
Limiting selection in a cell AND linking that selection to a list Lisa Microsoft Excel Misc 1 28th Jul 2009 05:00 PM
Force entry into cell, based on validation selection in adjacent cell Richhall Microsoft Excel Worksheet Functions 3 18th Jun 2009 10:28 AM
How to create a selection list then display the selection in a cell gbjhavard@googlemail.com Microsoft Excel Programming 0 1st Aug 2007 03:01 PM
get the value of a formula in cell B1 into cell A1 without changing my current cell selection News Microsoft Excel Programming 3 21st Oct 2006 12:24 AM
Change from Column Selection to Cell Selection Lil Pun Microsoft Excel Programming 4 16th Jun 2006 10:38 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 01:33 AM.