Check to see if anything has changed

alexaronson

Active Member
Joined
Sep 30, 2005
Messages
314
Hello and thank you for looking at my question.

I have a worksheet that has an area for comments and an area where the user will make edits. The worksheet also has some drop down list that the user can select to bring up new data.

Is it possible for excel to see if anything has changed on the worksheet since and prompt the user to record their changes (not save the change) before executing the macro that brings up new data?

Thanks for any suggestions

-To clearify what I mean about record is that the user hits a macro to send data to a data sheet that copies the edits so they can be compared to later.
 
Last edited:

Excel Facts

Spell Check in Excel
Press F7 to start spell check in Excel. Be careful, by default, Excel does not check Capitalized Werds (whoops)
I set up a worksheet named: Log (case sensitive)

<TABLE style="WIDTH: 492pt; BORDER-COLLAPSE: collapse" cellSpacing=0 cellPadding=0 width=656 border=0><COLGROUP><COL style="WIDTH: 78pt; mso-width-source: userset; mso-width-alt: 3803" width=104><COL style="WIDTH: 38pt; mso-width-source: userset; mso-width-alt: 1828" width=50><COL style="WIDTH: 104pt; mso-width-source: userset; mso-width-alt: 5083" width=139><COL style="WIDTH: 35pt; mso-width-source: userset; mso-width-alt: 1718" width=47><COL style="WIDTH: 237pt; mso-width-source: userset; mso-width-alt: 11556" width=316><TBODY><TR style="HEIGHT: 27pt; mso-height-source: userset" height=36><TD class=xl68 style="BORDER-RIGHT: windowtext 0.5pt solid; BORDER-TOP: windowtext 1pt solid; BORDER-LEFT: windowtext 1pt solid; WIDTH: 78pt; BORDER-BOTTOM: windowtext 1pt solid; HEIGHT: 27pt; BACKGROUND-COLOR: transparent" width=104 height=36>Date/Time</TD><TD class=xl69 style="BORDER-RIGHT: windowtext 0.5pt solid; BORDER-TOP: windowtext 1pt solid; BORDER-LEFT: windowtext; WIDTH: 38pt; BORDER-BOTTOM: windowtext 1pt solid; BACKGROUND-COLOR: transparent" width=50>User</TD><TD class=xl70 style="BORDER-RIGHT: windowtext 0.5pt solid; BORDER-TOP: windowtext 1pt solid; BORDER-LEFT: windowtext; WIDTH: 104pt; BORDER-BOTTOM: windowtext 1pt solid; BACKGROUND-COLOR: transparent" width=139>Worksheet Changed</TD><TD class=xl70 style="BORDER-RIGHT: windowtext 0.5pt solid; BORDER-TOP: windowtext 1pt solid; BORDER-LEFT: windowtext; WIDTH: 35pt; BORDER-BOTTOM: windowtext 1pt solid; BACKGROUND-COLOR: transparent" width=47>Cell Changed</TD><TD class=xl71 style="BORDER-RIGHT: windowtext 1pt solid; BORDER-TOP: windowtext 1pt solid; BORDER-LEFT: windowtext; WIDTH: 237pt; BORDER-BOTTOM: windowtext 1pt solid; BACKGROUND-COLOR: transparent" width=316>Cell Changed TO:</TD></TR></TBODY></TABLE>

Put the following code in "This Workbook":

Code:
Private Sub Workbook_SheetChange(ByVal Sh As Object, ByVal Target As Range)
Dim LR As Long
If Sh.Name = "Log" Then Exit Sub
Application.EnableEvents = False
With Sheets("Log")
    LR = .Range("A" & Rows.Count).End(xlUp).Row
    .Range("A" & LR + 1).Value = Now
    .Range("B" & LR + 1).Value = Environ("username")
    .Range("C" & LR + 1).Value = Sh.Name
    .Range("D" & LR + 1).Value = Target.Address(False, False)
    .Range("E" & LR + 1).Value = Target.Value
End With
Application.EnableEvents = True
End Sub

For mine, I hide the Log worksheet and Protect the Workbook Structure (so users can't manually edit the Log!) The user's Windows ID is used, which is more beneficial that using the user name in "Personalize your copy of Microsoft Office" as many people do not ever input their name.

There may be more sophisticated code available.
 
Upvote 0

Forum statistics

Threads
1,224,527
Messages
6,179,331
Members
452,907
Latest member
Roland Deschain

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