+ Reply to Thread
Results 1 to 4 of 4

Trouble Combining Codes

  1. #1
    Registered User
    Join Date
    05-06-2009
    Location
    chicago
    MS-Off Ver
    Excel 2003
    Posts
    6

    Trouble Combining Codes



    I've got the following code that will automatically UNFilter a worksheet before it saves.... works great & looks like this:

    Please Login or Register  to view this content.
    Now since I can't FORCE people to enable Macros - I found the following code which will take them to a welcome screen & won't show the worksheet UNTIL macros get enabled.... cool workaround - instructions are here followed by the code:

    - Rename a worksheet in your workbook to "Macros".
    - Put a message on the page telling the user to enable macros.
    - Copy above code.
    - In Excel press Alt + F11 to enter the VBE.
    - Press Ctrl + R to show the Project Explorer.
    - In the project explorer, locate the ThisWorkbook object.
    - Double click the ThisWorkbook object.
    - Paste code into the right pane.
    - Press Alt + Q to close the VBE.
    - Save workbook before any other changes.
    - Close and reopen the workbook

    Please Login or Register  to view this content.

    Problem is that when I try to combine these in the THIS WORKBOOK section - it tells me I've got an 'AMBIGUOUS NAME DETECTED' under Workspace_Save.... ok, I see that - but I can't just rename one of them - and my attempts to 'combine' these into 1 code have failed miserably (I'm a novice) - anybody got any ideas out there???

  2. #2
    Forum Expert
    Join Date
    01-03-2006
    Location
    Waikato, New Zealand
    MS-Off Ver
    2010 @ work & 2007 @ home
    Posts
    2,243

    Re: Trouble Combining Codes

    hi,

    I haven't tested this, but I think it is in the right place (code added between the hash sypmbols)...

    Quote Originally Posted by dogsoul View Post

    Please Login or Register  to view this content.
    I also recommend moving the non-event or "called" macros out of the ThisWorkbook module & placing them in a normal module (ie CustomSave, HideAllSheets & ShowAllSheets).


    hth
    Rob
    Rob Brockett
    Kiwi in the UK
    Always learning & the best way to learn is to experience...

  3. #3
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: Trouble Combining Codes

    There is no Workspace_Save event, do you mean WorkBook?

    Try attaching the workbook
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

  4. #4
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: Trouble Combining Codes

    dogsoul, per forum rules do not create duplicate threads.

    the other thread (where you had not added CODE tags @ shg's request) will be closed.

+ 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