Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1
Default 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   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 644
Default 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   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 644
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Using A Cell In Excel as Criteria for a Query charles Excel Discussion (Misc queries) 2 July 14th 06 05:06 PM
an excel formula for specific conditions srinivasan Excel Worksheet Functions 1 March 27th 06 06:20 AM
an excel formula for specific conditions Franksta Excel Worksheet Functions 0 March 26th 06 11:49 PM
Copy cell format to cell on another worksht and update automatical kevinm Excel Worksheet Functions 21 May 19th 05 11:07 AM
hyperlink an excel cell to a specific location wthin application f dirtboy New Users to Excel 1 January 17th 05 08:07 PM


All times are GMT +1. The time now is 04:22 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"