R
Roger on Excel
[Excel 2003]
I populate text boxes in userforms using the following type of code to
retrieve data from the worksheets:
Private Sub GetData_Click()
Dim ws As Worksheet
Set ws = Worksheets("Sheet 1")
Me.txt1.Value = ws.Range("A1").Value
Me.txt2.Value = ws.Range("B2").Value
Me.txt3.Value = ws.Range("C3").Text
End Sub
I can edit the text boxes and then send the edited information back to the
worksheets using:
Private Sub PutData_Click()
Dim ws As Worksheet
Set ws = Worksheets("Sheet 1")
ws.Range("A1").Value = Me.txt1.Value
ws.Range("B2").Value = Me.txt2.Value
ws.Range("C3").Value = Me.txt3.Value
End Sub
What I need is for additional code to check whether the retrieved data has
been changed by the user (in the form) and warn the user to update the
changes before they exit the form. A user may decide not to accept the
changes so I would need the original GetData information to be stored so that
it could be re-written over any unwanted changes.
Can anyone help with this?
Thank You, Roger
I populate text boxes in userforms using the following type of code to
retrieve data from the worksheets:
Private Sub GetData_Click()
Dim ws As Worksheet
Set ws = Worksheets("Sheet 1")
Me.txt1.Value = ws.Range("A1").Value
Me.txt2.Value = ws.Range("B2").Value
Me.txt3.Value = ws.Range("C3").Text
End Sub
I can edit the text boxes and then send the edited information back to the
worksheets using:
Private Sub PutData_Click()
Dim ws As Worksheet
Set ws = Worksheets("Sheet 1")
ws.Range("A1").Value = Me.txt1.Value
ws.Range("B2").Value = Me.txt2.Value
ws.Range("C3").Value = Me.txt3.Value
End Sub
What I need is for additional code to check whether the retrieved data has
been changed by the user (in the form) and warn the user to update the
changes before they exit the form. A user may decide not to accept the
changes so I would need the original GetData information to be stored so that
it could be re-written over any unwanted changes.
Can anyone help with this?
Thank You, Roger