Open Workbook
Press Alt+F11
On the Left side of the screen should be a VBAProject(YourWorkbook)
Double-Click to expand
Double-Click the Sheet with the cell of interest
At the top of the main screen are 2 comboboxes,
in the left one select "Worksheet"
in the right one select "Change"
Private Sub Worksheet_Change(ByVal Target As Range) Should appear
Add this before the "end sub":
If Target = Range("A1") Then 'Assumes A1 holdes critical value
UserForm1.Show
End If
Alternatively you can use a message box like this
If Target = Range("A1") Then
MsgBox "Budget is At $" & A1.Value, vbCritical, "Budget Under
$1000!"
End If
HTH
Die_Another_Day
David wrote:
Anyone know how to use a UserForm (made in the Visual Basic editor that is is
accessible via Excel's ToolsMacros menu) to display an error message when a
specific cell in a spreadsheet is below a certain value?
I have made the UserForm, but cannot figure out how to link the form to the
cell required. It is being used to alert the end user that their budget is
below $1000; once cell <1000 the form is meant to display.
This is the VB Code I have used:
Private Sub CommandButton1_Click()
End
End Sub
Private Sub UserForm_Click()
Hide UserForm1 = True
If Science!J1000 < 1000 Then
Show UserForm1 = True
Else
End Sub
Please note that I am an amateur user of Excel; please use plain language as
much as possible. :-)
Thanks