Re Macro For Last Action

S

Steved

Hello from Steved

This group kindly supplied me with the below macro.
It works ok but When I have opened several files and
put in "Private Sub Worksheet_Change(ByVal Target As Range)
Savit = Target End Sub" in to each file it does not work,
My question is
Can the below be more robust ie 'put it in a Regular module
as I am supposed to do but is their away where I can put
it a Module, so no matter what file I open it will operate
the macro please.

In a regular module, put this:

Public Savit
Sub MyPaste()
ActiveCell = Savit
End Sub

In the sheet module, put this:

Private Sub Worksheet_Change(ByVal Target As Range)
Savit = Target ' get last thing entered into cell
End Sub

Thankyou
 
E

Earl Kiosterud

Steved,

This won't work across workbooks. I think you'll have to put the two subs
in each workbook where you want to use it. When you run MyPaste, it will
only put information from the last action in the same workbook.
 
S

Steved

Hello Earl From Steved

I thought This may be the case, now I am aware I am happy.

Cheers.
 
Top