+ Reply to Thread
Results 1 to 5 of 5

VBA to remove all recorded except one to be linked to a print button

  1. #1
    Registered User
    Join Date
    08-13-2004
    Posts
    66

    VBA to remove all recorded except one to be linked to a print button

    I am preparing a work spreadsheet and would like to run a macro that will delete all macros saved in the spreadsheet including except one (as currently these macros used to build the report are still available in the View macro option). I would also like the vba code to assign to remaining macro to a button. Does anyone have such vba code?

  2. #2
    Forum Expert Solus Rankin's Avatar
    Join Date
    05-24-2013
    Location
    Hollywood, CA
    MS-Off Ver
    Win7 Office 2010 VS Express 2012
    Posts
    2,655

    Re: VBA to remove all recorded except one to be linked to a print button

    You could put all macros in a PERSONAL.xlsb and not even save them in the target spreadsheet. It would remain a .xls(x) without any scripting in the VBE.
    Thanks,
    Solus


    Please remember the following:

    1. Use [code] code tags [/code]. It keeps posts clean, easy-to-read, and maintains VBA formatting.
    Highlight the code in your post and press the # button in the toolbar.
    2. Show appreciation to those who have helped you by clicking below their posts.
    3. If you are happy with a solution to your problem, mark the thread as [SOLVED] using the tools at the top.

    "Slow is smooth, smooth is fast."

  3. #3
    Registered User
    Join Date
    08-13-2004
    Posts
    66

    Re: VBA to remove all recorded except one to be linked to a print button

    This sounds complicated, I would still need one macro to remain for a print button. Do you know of an example?

  4. #4
    Forum Expert Solus Rankin's Avatar
    Join Date
    05-24-2013
    Location
    Hollywood, CA
    MS-Off Ver
    Win7 Office 2010 VS Express 2012
    Posts
    2,655

    Re: VBA to remove all recorded except one to be linked to a print button

    Its not complicated. PERSONAL.xlsb is an excel spreadsheet that you can save all your macros to. If you save it in the right folder it will open 'hidden' every time you run excel. This means that no matter what spreadsheet you're currently editing you have the capability of calling any macro that you have created. All macros, including the print macro can be save here. That way the spreadsheet you're printing contains no macros at all. If you go to the macro recorder and look in the setup options, there should be an option to create a PERSONAL macro page and record to it.

    If you would like to upload the scripts you have so far I could assist in creating a personal.xlsb and help you locate the proper folder to save it in. What OS are you using?

  5. #5
    Registered User
    Join Date
    08-13-2004
    Posts
    66

    Re: VBA to remove all recorded except one to be linked to a print button

    Windows Server 2008 running Office 2007. Would this work as I create the report and run the macros while the spreadsheet is saved in a folder with restricted access, yet email the spreadsheet report out to over 100 colleauges most of whom would not have access to the restricted folder.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Print only current page! Not all 47 pages when print button is pressed?
    By Margate in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 04-11-2013, 10:06 AM
  2. [SOLVED] Recorded Pivot Table Macro Doesn't Do What I Recorded!
    By diakonos1984 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 03-26-2013, 11:01 AM
  3. disable command button once data is recorded
    By stoey in forum Excel Programming / VBA / Macros
    Replies: 21
    Last Post: 08-08-2008, 03:02 PM
  4. Remove Linked Object?
    By rockycj in forum Excel General
    Replies: 1
    Last Post: 02-07-2008, 04:54 AM
  5. S-l-o-w Recorded Print Macro
    By SkyDiver in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 02-07-2005, 05:00 PM

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