Thanks Thanks:  0
Likes Likes:  0
Results 1 to 3 of 3

Thread: Macro to save as but then keep original book active

  1. #1
    New Member
    Join Date
    Mar 2002
    Location
    Rae Winn
    Posts
    2
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    I have a workbook with a data entry sheet and product sheets. All data is entered in dataentry and then distributed to correct worksheet. My question is this: After data entry I want the active worksheet to be saved to a name I have provided in code(this works) but then I have a macro that I need to run to change info in the original worksheet (get cumalitive totals and wipe out data entry sheet). Where do I put macros so it runs properly?
    I have a button that runs the 'save as' code but then the original workbook is not active and my 'savetotals' and 'clear dataentry' does not work.(all on same button)

    Any help will be appreciated! Great site, by the way.

    Rae Winn

  2. #2
    Board Regular
    Join Date
    Feb 2002
    Location
    Brisbane, Down Under
    Posts
    542
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    rwinn - before you saveas you need to include some code to capture your current workbook such as
    ThisBook = ActiveWorkbook.Name
    once you saveas then reopen it in your macro as
    Workbooks.Open FileName:=(Thisbook)
    On 2002-03-20 12:41, rwinn wrote:
    I have a workbook with a data entry sheet and product sheets. All data is entered in dataentry and then distributed to correct worksheet. My question is this: After data entry I want the active worksheet to be saved to a name I have provided in code(this works) but then I have a macro that I need to run to change info in the original worksheet (get cumalitive totals and wipe out data entry sheet). Where do I put macros so it runs properly?
    I have a button that runs the 'save as' code but then the original workbook is not active and my 'savetotals' and 'clear dataentry' does not work.(all on same button)

    Any help will be appreciated! Great site, by the way.

    Rae Winn

  3. #3
    New Member
    Join Date
    Mar 2002
    Location
    Rae Winn
    Posts
    2
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    What I decided to do is make two buttons- 1 that saves the current file, 'saves as' to specified file name, and reopens original book. 2 Calculates all cumalitives, clears dataentry and resaves the form so its ready for dataentry.

    Yea, forgot to save the original form before going on this rollercoaster.

    Thanks for the help.

    Rae Winn

Some videos you may like

User Tag List

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

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