Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1,388
Default Writing Macro to Run after changes are made

Is there a way to write a macro that would put up a reminder like "Take PSV
of Total Column on CLIN Tab." anytime a total in a certain cell changes?

I have a file with 50+ tabs that all end up providing data to a final
summary tab. In column Y97 there is a grand total. Anytime we make a
financial (number) change to any of the tabs that causes the total in Y97 to
change, I would like the message above to pop up. I need to make sure I am
creating an "audit" trail anytime the grand total changes and a reminder
would be nice becuase it sucks to go back and recreate a step that was missed.

Please let me know if you need more information to help me.

I appreciate any help.

Thanks
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35,218
Default Writing Macro to Run after changes are made

Maybe...

Y97 on the summary worksheet contains a formula, right?

Excel has some events that it monitors and one of those events is a _calculate
event. So each time excel recalcs, you could show a message. You could even
compare that existing value in y97 to the new value and decide when to show it.

But if you're worried about the user doing something, why not have the macro do
it for them (or even a formula do it for them)?

And if you really wanted an audit, you could monitor ranges on the 50 different
worksheets (the _change event fires when a typing change takes place). And then
put some logging information (user, date/time, cell address, worksheet address,
new value) in another worksheet.



Dave wrote:

Is there a way to write a macro that would put up a reminder like "Take PSV
of Total Column on CLIN Tab." anytime a total in a certain cell changes?

I have a file with 50+ tabs that all end up providing data to a final
summary tab. In column Y97 there is a grand total. Anytime we make a
financial (number) change to any of the tabs that causes the total in Y97 to
change, I would like the message above to pop up. I need to make sure I am
creating an "audit" trail anytime the grand total changes and a reminder
would be nice becuase it sucks to go back and recreate a step that was missed.

Please let me know if you need more information to help me.

I appreciate any help.

Thanks


--

Dave Peterson
  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 266
Default Writing Macro to Run after changes are made

Put the code below in your worksheet. To do that - right click on the
worksheet - select "View Code" and paste in the code. Change $Y$100 to your
address .


Private Sub Worksheet_Change(ByVal Target As Range)

'Do nothing if more than one cell is changed or content deleted

If Target.Cells.Count 1 Or IsEmpty(Target) Then
Exit Sub
End If

' Replace $Y$100 with your cell location - keep the "$"

If Target.Address = "$Y$100" Then


'Stop any possible runtime errors and halting code

On Error Resume Next

'Turn off ALL events so the change does not put the code into a loop.

Application.EnableEvents = False



MsgBox "Take PSV of Total Column on CLIN Tab."

'Turn events back on

Application.EnableEvents = True

'Allow run time errors again

On Error GoTo 0

End If

End Sub



"Dave" wrote:

Is there a way to write a macro that would put up a reminder like "Take PSV
of Total Column on CLIN Tab." anytime a total in a certain cell changes?

I have a file with 50+ tabs that all end up providing data to a final
summary tab. In column Y97 there is a grand total. Anytime we make a
financial (number) change to any of the tabs that causes the total in Y97 to
change, I would like the message above to pop up. I need to make sure I am
creating an "audit" trail anytime the grand total changes and a reminder
would be nice becuase it sucks to go back and recreate a step that was missed.

Please let me know if you need more information to help me.

I appreciate any help.

Thanks

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
macro writing dannyboy8 Excel Worksheet Functions 1 April 22nd 09 02:51 AM
Writing Data with a macro??? Ted[_3_] New Users to Excel 7 January 4th 09 08:25 PM
Writing a macro RB[_2_] Excel Worksheet Functions 0 January 14th 08 05:40 PM
Macro-writing problems Richard Excel Discussion (Misc queries) 6 January 20th 07 10:45 PM
writing macro CN New Users to Excel 2 August 2nd 05 06:16 PM


All times are GMT +1. The time now is 01:36 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"