Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 413
Default 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


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default 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




  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default 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




  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 413
Default 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


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
InputBox peyman Excel Discussion (Misc queries) 4 September 28th 07 04:53 PM
Inputbox with VBA Jeff Excel Discussion (Misc queries) 3 January 19th 06 05:18 PM
InputBox Method Logic Problem ExcelMonkey[_20_] Excel Programming 2 January 24th 04 04:47 AM
inputbox defj Excel Programming 4 November 26th 03 10:25 PM
inputbox Lawson Excel Programming 2 October 7th 03 08:58 PM


All times are GMT +1. The time now is 07:43 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"