Home |
Search |
Today's Posts |
|
#1
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
Using an Excel VB-made form in cell-specific conditions.
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 |
#2
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
Using an Excel VB-made form in cell-specific conditions.
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 |
#3
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
Using an Excel VB-made form in cell-specific conditions.
Crap. Got going too fast and forgot what I was doing... Oh well bedtime
I guess If Range("A1") < 1000 Then 'Assumes A1 holdes critical value UserForm1.Show End If Alternatively you can use a message box like this If Range("A1") < 1000 Then 'Assumes A1 holdes critical value MsgBox "Budget is At $" & A1.Value, vbCritical, "Budget Under $1000!" End If Maybe that one will help... Die_Another_Day Die_Another_Day wrote: 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 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Using A Cell In Excel as Criteria for a Query | Excel Discussion (Misc queries) | |||
an excel formula for specific conditions | Excel Worksheet Functions | |||
an excel formula for specific conditions | Excel Worksheet Functions | |||
Copy cell format to cell on another worksht and update automatical | Excel Worksheet Functions | |||
hyperlink an excel cell to a specific location wthin application f | New Users to Excel |