ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Are Reversing Macros Possible??? (https://www.excelbanter.com/excel-programming/335803-reversing-macros-possible.html)

guilf

Are Reversing Macros Possible???
 

Can you create a macro that simply reverses another macro.

much like a reversing month end Journal???

Ie MACRO 1

the macro hides column N, then multiplies Column C x D

Can I make a macro to reverse this?

MACRO 2

divides column D / C , then unhides column N

I realise that this is a simple example and i could create a separate
macro, but the macro I wish to reverse is much larger!!

Anyone got any ideas??


ta muchly all!!


--
guilf
------------------------------------------------------------------------
guilf's Profile: http://www.excelforum.com/member.php...o&userid=25608
View this thread: http://www.excelforum.com/showthread...hreadid=391018


bhofsetz[_118_]

Are Reversing Macros Possible???
 

Of course you can reverse the macro. Just start at the bottom and wor
your way up.

Are you going for an 'undo' type of functionality after running
macro

--
bhofset
-----------------------------------------------------------------------
bhofsetz's Profile: http://www.excelforum.com/member.php...fo&userid=1880
View this thread: http://www.excelforum.com/showthread.php?threadid=39101


GregR

Are Reversing Macros Possible???
 
AFAIK there is no undo function with a macro. A workaround however is
to use a revertToLastSaved macro which returns you to the last saved
state if the results of the macro are unsatisfactory, such as:

Sub RevertFile()

wkname = ActiveWorkbook.Path & "\" & ActiveWorkbook.Name
ActiveWorkbook.Close savechanges:=False

Workbooks.Open FileName:=wkname

End Sub

Greg



All times are GMT +1. The time now is 07:23 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com