Results 1 to 3 of 3

Thread: Changing button names - [resolved]

Threaded View

  1. #1

    Thread Starter
    Lively Member TheFIDDLER's Avatar
    Join Date
    May 2002
    Location
    here and there and far away
    Posts
    126

    Changing button names - [resolved]

    Ok - new one for you guys and gals.

    I have a sheet with three Form Control buttons. Each button has a macro assigned to it. There is a Back, a Next and a Print button.

    I copy the sheet to a new workbook (see my previous answer to DaveBo's post for code example). Code works exceptionally well and moves the sheet to a new workbook. Now from here, I want to strip the sheet of the three Form Control Buttons.

    It is a very straightforward code approach to accomplish this.
    Essentially, something like, with sheets(1).Shapes("Button 2").Cut
    I name the shape by name since I have lots of other shapes on the sheet that must remain in place as they are graphics and are an integral part of my presentation.

    Problem is that Excel randomly renames my buttons for me while pasting. Button 38 can become Button 42. It is consistent providing I start with the same base number of buttons, but if I start another version of Excel, or open another workbook, then it increments its Button count to match, leaving my code dead in the water.

    I would like suggestions as to how to code to trap just my three buttons while leaving out the rest of my shapes. Something that would be irrelevant of the button number would be nice.
    Last edited by TheFIDDLER; Apr 27th, 2004 at 04:27 PM.
    -----
    #VBA, VB 6 Professional Edition, Office XP Developper. Excel 97, Excel 2000, Excel XP

    I miss my VIC 20.
    Never should have upgraded to my commodore 64. ...

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width