Question about Macro Managment

shdawson

Active Member
Joined
Jan 6, 2007
Messages
381
Hi,


I have a large workbook. So large, I have manual calcuations and DO NOT CALCULATE upon closing selected.

I have a macro, works great. Needed to edit the macro. Did so. Saved, exit the workbook, go back in, the macro changes are there.

However, when I run the macro, it still performs based upon the original code. It is like there is versioning of the marco happening.

What needs to happen to get this resolved, please?


Thanks,
SHD
 

Excel Facts

Can a formula spear through sheets?
Use =SUM(January:December!E7) to sum E7 on all of the sheets from January through December
Did you look at all the code behind all objects? You may have the same macro in the module and on a sheet too
 
Upvote 0
Sorry, not clear how to investigate this.

I made the macro via the record-macro thingy.

I see the macro under modules/module 4.

Please, how do I investigate what you recommend?


THank You,
SHD
 
Upvote 0
Maybe the changes you made are not doing what you think they should be doing... can you show us the code and indicate where the parts are that you think do not work?
 
Upvote 0
This is in an XLS file, not an Access file.


Code:
    Sheets("Portfolio Variance").Select
    On Error Resume Next
    ActiveSheet.ShowAllData
    On Error GoTo 0
    Range("B3:T60000").Select
    Selection.ClearContents
    Range("B2").Select
    ActiveWorkbook.Save

Changed T60000 from U60000, as I moved columns around.

Colum U is still being cleared from row 3 to row 60000.


?

Thanks,
SHD
 
Upvote 0
Sorry, not clear how to investigate this.
Please, how do I investigate what you recommend?
Close all workbooks except the one in question. Press Alt-F11 to open VBA. Press Ctrl-R to view the Project Explorer. Identify your workbook and press the little + plus sign to expend its contents.

Under Microsoft Excel Objects, identify your worksheets - probably called Sheet1 (sheetname), etc - and ThisWorkbook.

Under Modules, identify your standard modules - probably called Module1, etc.

Open each of them in turn by double-clicking their names and then examining the contents of their code windows. One of them will contain the code you posted. Do any of the others contain similar code?

Since you are currently on Module4, I assume you created three other modules at some point. Have you deleted them or are you perhaps making changes to one piece of code but actually running a different piece of code?
 
Upvote 0
Ruddles,


Hi. Thanks for the info.

Yes, I am on the correct module, in the correct workbook.


To that end, not sure why this change to the macro is not being maintaned in the code when I close the workbook, open the workbook, and see the said change.


Please advise.


Thanks,
S
 
Upvote 0
Do you have any code which triggers when yoiu save or close the workbook?

Have you tried clicking 'save' in VBA before you exit the workbook?

If all else fails, I'll be happy to take a look: my email addy is on its way to you via PM.
 
Upvote 0

Forum statistics

Threads
1,224,521
Messages
6,179,291
Members
452,902
Latest member
Knuddeluff

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