Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
button names changed on copied sheet
These damn buttons....
I have a collection of form buttons on sheet. They are all assigned to the same sub(). In that sub() I obtain their name: Dim button_name As String: button_name = Application.Caller When I do a copy sheet (leftclick tab, move or copy, x create copy) everything is just fine EXCEPT the buttons have changed their names. Select Case button_name Case "Button 2" row_day = oMyWs.Range("row_day_1").row Case "Button 3" row_day = oMyWs.Range("row_day_2").row The above fails because "Button 2" is now "Button 1". There is no "Button 1" on the source page (probably having been deleted during development) What gives? Can I fix this or am I doomed. Thank you. Excel 2010 |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
button names changed on copied sheet
See my reply to your other post! My suggestion fixes all unexpected
behaviors associated with using controls on worksheets... -- Garry Free usenet access at http://www.eternal-september.org Classic VB Users Regroup! comp.lang.basic.visual.misc microsoft.public.vb.general.discussion --- This email is free from viruses and malware because avast! Antivirus protection is active. http://www.avast.com |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
button names changed on copied sheet
|
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
button names changed on copied sheet
Garry... See my reply to your other post! My suggestion fixes all unexpected behaviors associated with using controls on worksheets... The source sheet contained buttons "Button 2"....3,4,5,6 This worked Set shp2 = ws.Shapes.Item("Button 2") shp2.Name = "Button 1" But this failed Set shp2 = ws.Shapes.Item("Button 3") shp2.Name = "Button 2" I reloaded the object... still failed. That name persists somewhere but I couldn't find it. I dumped the names and "Button 2" was not in use. I finally mangled them but good, as in "ButtonDay1", "ButtonDay2" ..... 14 and everything renamed just fine. Thanks. |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
button names changed on copied sheet
Garry...
See my reply to your other post! My suggestion fixes all unexpected behaviors associated with using controls on worksheets... The source sheet contained buttons "Button 2"....3,4,5,6 This worked Set shp2 = ws.Shapes.Item("Button 2") shp2.Name = "Button 1" But this failed Set shp2 = ws.Shapes.Item("Button 3") shp2.Name = "Button 2" I reloaded the object... still failed. That name persists somewhere but I couldn't find it. I dumped the names and "Button 2" was not in use. I finally mangled them but good, as in "ButtonDay1", "ButtonDay2" ..... 14 and everything renamed just fine. Thanks. FOR NOW!!! See what happens next time you hide/unhide the area... -- Garry Free usenet access at http://www.eternal-september.org Classic VB Users Regroup! comp.lang.basic.visual.misc microsoft.public.vb.general.discussion --- This email is free from viruses and malware because avast! Antivirus protection is active. http://www.avast.com |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
When a sheet is copied, i want also that the Sub's whithin this sheet is copied to the new sheet | Excel Programming | |||
The column names (A,B,C, etc...) changed to numbers?????????? | Setting up and Configuration of Excel | |||
Duplicate names on copied worksheet | Links and Linking in Excel | |||
The columns names on my sheet have changed!! | Excel Discussion (Misc queries) | |||
names changed somehow | Excel Programming |