pop up message that tells you all the changes you made to a spreadsheet

hopr37

Board Regular
Joined
Apr 16, 2018
Messages
76
I use a lot of data entry on my spreadsheet.
Is there a way to create a message box that will tell me the entries that I made during the day?
I have 3 different cells that would need to be displayed.
the first cell ( cell A) is just a description
the second cell ( Cell B) is an amount that I input
the third cell ( Cell C) is an amount that is subtracted from the second cell.

So as an example if I made 3 changes I could hit a button and a message would pop up indicated the 3 cells and what was done with them.
"you have changed:
"description, amount, amount"
"description, amount, amount"
description, amount, amount"

and then reset if I close the worksheet.

Thank You
 

Excel Facts

Format cells as currency
Select range and press Ctrl+Shift+4 to format cells as currency. (Shift 4 is the $ sign).
Re: pop up message tht tells you all the changes you made to a spreadsheet

I would recommend adding VBA code that add a date/time stamp in some column when a row is updated (search "Excel VBA DateTime Stamp" to see lots of posts with that code).
Then, I think I would use Advanced Filters to filter the ones from today to a new sheet (can also be automated using VBA).
 
Upvote 0
Re: pop up message tht tells you all the changes you made to a spreadsheet

What you describe is actually 9 changes, as it would be difficult to track unless you can guarantee that you will always make the 3 changes in 1 'go'. As a simple alternative that you could develop as needed, this code will track each cells change:

Put the following into the worksheet code area (right-click the sheet name and select View code then paste the code below)
Code:
Private Sub Worksheet_Change(ByVal Target As Range)
logger = logger + vbNewLine + Target.Address + " was " + PrevVal + " - now " + Target.Value
End Sub

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
PrevVal = Target.Value
End Sub

You will also need these 2 declarations ans simple subroutine in a module (point your button at this macro):

Code:
Global logger As String
Global PrevVal As String

Sub showhist()
MsgBox logger

End Sub
 
Upvote 0
Re: pop up message tht tells you all the changes you made to a spreadsheet

Thank you for that. I created a button and placed the main code in my worksheet and the declarations in a module.
However, I get a blank pop up box.
 
Upvote 0
Re: pop up message tht tells you all the changes you made to a spreadsheet

hmmm.
Hit the button and getting "invalid attribute in sub or function"

Sub Button1_Click()
Global logger As String
 
Last edited:
Upvote 0
Re: pop up message tht tells you all the changes you made to a spreadsheet

hmmm.
Hit the button and getting "invalid attribute in sub or function"

Sub Button1_Click()
Global logger As String

It looks like youve got the global inside the sub rather than at the top.
 
Upvote 0
Re: pop up message tht tells you all the changes you made to a spreadsheet

It works. ( I was moving things around and I had the same info in two different spots)
However, i still get a blank popup with no info.
 
Upvote 0
Re: pop up message tht tells you all the changes you made to a spreadsheet

Oh dear. I'll explain the code and see if that helps you find where the problem is. The Worksheet_SelectionChange code just catches the current value of the cell you have just clicked on. The Worksheet_Change code then appends the cell address, before and after values to the logger variable. Then the button code just displays the logger data. I suspect the global definitions may not be in the right place. You could set a break point on the 2 end subs in the worksheet code and make sure they are being executed. At that point, you can see what the logger variable is set to. I hope this helps, but if not then i'm a bit stumped since it works fine in my test workbook.
 
Upvote 0
Re: pop up message tht tells you all the changes you made to a spreadsheet

can't set breakpoints and no matter where I place the globals I still get a blank message box
 
Upvote 0

Forum statistics

Threads
1,223,214
Messages
6,170,774
Members
452,353
Latest member
strainu

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