Macro to save as but then keep original book active

rwinn

New Member
Joined
Mar 19, 2002
Messages
2
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
 

Excel Facts

Waterfall charts in Excel?
Office 365 customers have access to Waterfall charts since late 2016. They were added to Excel 2019.
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
 
Upvote 0
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
 
Upvote 0

Forum statistics

Threads
1,213,529
Messages
6,114,155
Members
448,554
Latest member
Gleisner2

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top