Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 430
Default Use of sheet codename in codeline - How?

Just spend 20-30 minutes going thru the Google Archive
Looking for an answer to my subject line

After 19-29 minutes of confusion, I just came up with the below code;
It seems to work -- but I'm asking "Is there a "gotch-Cha"
Associated with it? Seems simple enough - In the Interface my 3rd of 3
sheets shows "Page3" -- but of course in the VBA Properties Window
(Name) box I show MySheet3codename

Sub Selectsheettest()
MySheet3codename.Activate
Range("B4").Value = "hello - You made it !!"
End Sub

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default Use of sheet codename in codeline - How?

There's always gotcha's when you rely on being on the active sheet.

I would think that this would be better:

MySheet3codename.Range("B4").Value = "hello - You made it !!"

Codenames are much more difficult for the average user to screw up, er, change.
I think you'll be much happier with your code using codenames when the worksheet
name changes.

Jim May wrote:

Just spend 20-30 minutes going thru the Google Archive
Looking for an answer to my subject line

After 19-29 minutes of confusion, I just came up with the below code;
It seems to work -- but I'm asking "Is there a "gotch-Cha"
Associated with it? Seems simple enough - In the Interface my 3rd of 3
sheets shows "Page3" -- but of course in the VBA Properties Window
(Name) box I show MySheet3codename

Sub Selectsheettest()
MySheet3codename.Activate
Range("B4").Value = "hello - You made it !!"
End Sub


--

Dave Peterson
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 430
Default Use of sheet codename in codeline - How?

Dave, Thanks for the closure (of this issue).
Jim May

"Dave Peterson" wrote in message
:

There's always gotcha's when you rely on being on the active sheet.

I would think that this would be better:

MySheet3codename.Range("B4").Value = "hello - You made it !!"

Codenames are much more difficult for the average user to screw up, er, change.
I think you'll be much happier with your code using codenames when the worksheet
name changes.

Jim May wrote:


Just spend 20-30 minutes going thru the Google Archive
Looking for an answer to my subject line

After 19-29 minutes of confusion, I just came up with the below code;
It seems to work -- but I'm asking "Is there a "gotch-Cha"
Associated with it? Seems simple enough - In the Interface my 3rd of 3
sheets shows "Page3" -- but of course in the VBA Properties Window
(Name) box I show MySheet3codename

Sub Selectsheettest()
MySheet3codename.Activate
Range("B4").Value = "hello - You made it !!"
End Sub



--

Dave Peterson


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
string to codename rk0909 Excel Discussion (Misc queries) 4 September 25th 08 10:57 PM
change sheet codename Gary Keramidas Excel Programming 4 March 5th 06 12:54 AM
codename help Gary Keramidas Excel Programming 14 October 31st 05 12:32 AM
Selecting a sheet by codename Dr.Schwartz Excel Programming 3 September 3rd 04 02:15 PM
Using sheet codename problems Dustin Carter Excel Programming 1 February 20th 04 10:26 PM


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

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

About Us

"It's about Microsoft Excel"