+ Reply to Thread
Results 1 to 3 of 3

Removing command buttons using code

  1. #1
    Registered User
    Join Date
    10-23-2006
    Posts
    6

    Removing command buttons using code

    Hi

    I've written a sheet that performs some locic checks, and written code to "roll forward" the sheet (i.e. increase the years by 1, replace the brought forward figures with the carried forward figures etc), and attached it to a command button embedded in the sheet.

    When the sheet rolls forward, it copies itself and creates a back up sheet. However, it also copies the command buttons that are embedded into the sheet. Does anyone know to delete the command buttons from the duplicate sheet?

    Also - does anyone one know how to prevent the command buttons from printing?

    One final thing - is it possible to automatically set the print margins to fit all the data on the sheet onto one page

    Thanks in advance

    Charlie

  2. #2
    Forum Contributor
    Join Date
    06-10-2004
    Location
    India
    Posts
    1,066
    To prevent cmd button from printing, right click on the button, format control, properties tab, uncheck print object.

    To generate code for fitting the margins, start recording a macro (Tools > Macro > Record new macro).
    Then go to File > Page setup > Page tab, select the Fit to radio button in scaling, click ok.
    Stop recording the macro (Tools > Macro > stop recording).

    A code is generated which you can then run when you want to fit the margins.


    Mangesh

  3. #3
    Registered User
    Join Date
    10-23-2006
    Posts
    6

    Thanks

    Much Appreciated!

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1