ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Inputbox for Worksheet name - problem (https://www.excelbanter.com/excel-programming/291331-inputbox-worksheet-name-problem.html)

Stuart[_5_]

Inputbox for Worksheet name - problem
 
I'm using:
WkSheetName = Application.InputBox("Please type a name for" & _
" this Worksheet ... in CAPITALS")
'update the user
Application.StatusBar = ".....now processing... " & WkSheetName
ActiveSheet.Name = WkSheetName

User's are reporting an occasional error (1004: While renaming you entered
an illegal character..etc) on the line:
ActiveSheet.Name = WkSheetName

When I check, I can see that somehow WkSheetName has the value
: WkSheetName : "EXTERNAL+$1:$1WORKS" : String in the
Locals window, as opposed to the correct value of:
EXTERNAL WORKS.

How might this have occured, and can I prevent it please?

Regards.


---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.586 / Virus Database: 371 - Release Date: 12/02/2004



Bob Phillips[_6_]

Inputbox for Worksheet name - problem
 


--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"Stuart" wrote in message
...
I'm using:
WkSheetName = Application.InputBox("Please type a name for" & _
" this Worksheet ... in CAPITALS")
'update the user
Application.StatusBar = ".....now processing... " &

WkSheetName
ActiveSheet.Name = WkSheetName

User's are reporting an occasional error (1004: While renaming you entered
an illegal character..etc) on the line:
ActiveSheet.Name = WkSheetName

When I check, I can see that somehow WkSheetName has the value
: WkSheetName : "EXTERNAL+$1:$1WORKS" : String in the
Locals window, as opposed to the correct value of:
EXTERNAL WORKS.

How might this have occured, and can I prevent it please?

Regards.


---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.586 / Virus Database: 371 - Release Date: 12/02/2004





Bob Phillips[_6_]

Inputbox for Worksheet name - problem
 
Stuart,

You are using Application.Inputbox, and this allows more flexibility in
inputting data. Unfortunately, this can include any cells selected, which is
your problem.

Use this instead

WkSheetName = InputBox("Please type a name for" & _
" this Worksheet ... in CAPITALS")

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"Stuart" wrote in message
...
I'm using:
WkSheetName = Application.InputBox("Please type a name for" & _
" this Worksheet ... in CAPITALS")
'update the user
Application.StatusBar = ".....now processing... " &

WkSheetName
ActiveSheet.Name = WkSheetName

User's are reporting an occasional error (1004: While renaming you entered
an illegal character..etc) on the line:
ActiveSheet.Name = WkSheetName

When I check, I can see that somehow WkSheetName has the value
: WkSheetName : "EXTERNAL+$1:$1WORKS" : String in the
Locals window, as opposed to the correct value of:
EXTERNAL WORKS.

How might this have occured, and can I prevent it please?

Regards.


---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.586 / Virus Database: 371 - Release Date: 12/02/2004





Stuart[_5_]

Inputbox for Worksheet name - problem
 
Thanks.

Seems hitting the spacebar with the shift key depressed gives an
unexpected bonus (namely the activecell address). Another thing
I didn't know!

Regards.

"Bob Phillips" wrote in message
...
Stuart,

You are using Application.Inputbox, and this allows more flexibility in
inputting data. Unfortunately, this can include any cells selected, which

is
your problem.

Use this instead

WkSheetName = InputBox("Please type a name for" & _
" this Worksheet ... in CAPITALS")

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"Stuart" wrote in message
...
I'm using:
WkSheetName = Application.InputBox("Please type a name for" & _
" this Worksheet ... in CAPITALS")
'update the user
Application.StatusBar = ".....now processing... " &

WkSheetName
ActiveSheet.Name = WkSheetName

User's are reporting an occasional error (1004: While renaming you

entered
an illegal character..etc) on the line:
ActiveSheet.Name = WkSheetName

When I check, I can see that somehow WkSheetName has the value
: WkSheetName : "EXTERNAL+$1:$1WORKS" : String in the
Locals window, as opposed to the correct value of:
EXTERNAL WORKS.

How might this have occured, and can I prevent it please?

Regards.


---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.586 / Virus Database: 371 - Release Date: 12/02/2004






---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.586 / Virus Database: 371 - Release Date: 12/02/2004




All times are GMT +1. The time now is 05:38 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com