Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11
Default Displaying a User Form

I have a shared file where people enter a number in column B8 through 228. In
column K8 through 228 are formulas that look at the numbers in column B and
deliver a "Yes" or a "No." I want Excel to show user-form1 whenever a formula
delivers a "No." When the user-form is displayed, the user will click the OK
button to close the user form and allow the next user to repeat the process.

I'm really spinning my wheels on this. Your help would be greatly appreciated!
Thanks in advance. - DN
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 167
Default Displaying a User Form

Dan,

If each cell (B8:B228) is entered individually the following code will show
UserFrom1 whenever a change in column B results in a No in column K.

Private Sub Worksheet_Change(ByVal Target As Range)
If Not Intersect(Target.Cells, Range("B8:B228")) Is Nothing Then
If Target.Offset(0, 9).Value = "No" Then UserForm1.Show
End If
End Sub

If the cells (B8:B228) may be entered in groups then a modification will
need to be made - perhaps a For Loop - to accomplish the same. Let me know
if you need help with that.

Mike


"Dan N" wrote:

I have a shared file where people enter a number in column B8 through 228. In
column K8 through 228 are formulas that look at the numbers in column B and
deliver a "Yes" or a "No." I want Excel to show user-form1 whenever a formula
delivers a "No." When the user-form is displayed, the user will click the OK
button to close the user form and allow the next user to repeat the process.

I'm really spinning my wheels on this. Your help would be greatly appreciated!
Thanks in advance. - DN

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11
Default Displaying a User Form

Mike - Thank you for your response.
Your code did exactly what I need but because I already had some code on
that sheet that started with"Private Sub Worksheet_Change(ByVal Target As
Range)" it caused this error -- "Ambiguous name detected:Worksheet_Change."
Should I put your code in a module instead of on the sheet with the formulas?

I'm also having a problem getting my commandbutton2 to cancel the user-form.
- Dan

"crazybass2" wrote:

Dan,

If each cell (B8:B228) is entered individually the following code will show
UserFrom1 whenever a change in column B results in a No in column K.

Private Sub Worksheet_Change(ByVal Target As Range)
If Not Intersect(Target.Cells, Range("B8:B228")) Is Nothing Then
If Target.Offset(0, 9).Value = "No" Then UserForm1.Show
End If
End Sub

If the cells (B8:B228) may be entered in groups then a modification will
need to be made - perhaps a For Loop - to accomplish the same. Let me know
if you need help with that.

Mike


"Dan N" wrote:

I have a shared file where people enter a number in column B8 through 228. In
column K8 through 228 are formulas that look at the numbers in column B and
deliver a "Yes" or a "No." I want Excel to show user-form1 whenever a formula
delivers a "No." When the user-form is displayed, the user will click the OK
button to close the user form and allow the next user to repeat the process.

I'm really spinning my wheels on this. Your help would be greatly appreciated!
Thanks in advance. - DN

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 167
Default Displaying a User Form

Dan,

Since you already have a Worksheet_Change event just put the three lines of
code within that proceedure. Just make sure it is not nested within other
commands. To ensure that is the case insert the three lines directly below
the Private Sub Worksheet_Change line as shown below:

Private Sub Worksheet_Change(ByVal Target As Range)
If Not Intersect(Target.Cells, Range("B8:B228")) Is Nothing Then
If Target.Offset(0, 9).Value = "No" Then UserForm1.Show
End If
....
the other code
....
End Sub

That should do the trick.

Mike

"Dan N" wrote:

Mike - Thank you for your response.
Your code did exactly what I need but because I already had some code on
that sheet that started with"Private Sub Worksheet_Change(ByVal Target As
Range)" it caused this error -- "Ambiguous name detected:Worksheet_Change."
Should I put your code in a module instead of on the sheet with the formulas?

I'm also having a problem getting my commandbutton2 to cancel the user-form.
- Dan

"crazybass2" wrote:

Dan,

If each cell (B8:B228) is entered individually the following code will show
UserFrom1 whenever a change in column B results in a No in column K.

Private Sub Worksheet_Change(ByVal Target As Range)
If Not Intersect(Target.Cells, Range("B8:B228")) Is Nothing Then
If Target.Offset(0, 9).Value = "No" Then UserForm1.Show
End If
End Sub

If the cells (B8:B228) may be entered in groups then a modification will
need to be made - perhaps a For Loop - to accomplish the same. Let me know
if you need help with that.

Mike


"Dan N" wrote:

I have a shared file where people enter a number in column B8 through 228. In
column K8 through 228 are formulas that look at the numbers in column B and
deliver a "Yes" or a "No." I want Excel to show user-form1 whenever a formula
delivers a "No." When the user-form is displayed, the user will click the OK
button to close the user form and allow the next user to repeat the process.

I'm really spinning my wheels on this. Your help would be greatly appreciated!
Thanks in advance. - DN

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 167
Default Displaying a User Form

Without seeing the code for commandbutton2 I can't be of much help there.



"Dan N" wrote:

Mike - Thank you for your response.
Your code did exactly what I need but because I already had some code on
that sheet that started with"Private Sub Worksheet_Change(ByVal Target As
Range)" it caused this error -- "Ambiguous name detected:Worksheet_Change."
Should I put your code in a module instead of on the sheet with the formulas?

I'm also having a problem getting my commandbutton2 to cancel the user-form.
- Dan

"crazybass2" wrote:

Dan,

If each cell (B8:B228) is entered individually the following code will show
UserFrom1 whenever a change in column B results in a No in column K.

Private Sub Worksheet_Change(ByVal Target As Range)
If Not Intersect(Target.Cells, Range("B8:B228")) Is Nothing Then
If Target.Offset(0, 9).Value = "No" Then UserForm1.Show
End If
End Sub

If the cells (B8:B228) may be entered in groups then a modification will
need to be made - perhaps a For Loop - to accomplish the same. Let me know
if you need help with that.

Mike


"Dan N" wrote:

I have a shared file where people enter a number in column B8 through 228. In
column K8 through 228 are formulas that look at the numbers in column B and
deliver a "Yes" or a "No." I want Excel to show user-form1 whenever a formula
delivers a "No." When the user-form is displayed, the user will click the OK
button to close the user form and allow the next user to repeat the process.

I'm really spinning my wheels on this. Your help would be greatly appreciated!
Thanks in advance. - DN



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11
Default Displaying a User Form

Mike,

That did it! Everything is working great. You not only solved my problem but
you also taught me something new. Thank you so much!!
- Dan

"crazybass2" wrote:

Without seeing the code for commandbutton2 I can't be of much help there.



"Dan N" wrote:

Mike - Thank you for your response.
Your code did exactly what I need but because I already had some code on
that sheet that started with"Private Sub Worksheet_Change(ByVal Target As
Range)" it caused this error -- "Ambiguous name detected:Worksheet_Change."
Should I put your code in a module instead of on the sheet with the formulas?

I'm also having a problem getting my commandbutton2 to cancel the user-form.
- Dan

"crazybass2" wrote:

Dan,

If each cell (B8:B228) is entered individually the following code will show
UserFrom1 whenever a change in column B results in a No in column K.

Private Sub Worksheet_Change(ByVal Target As Range)
If Not Intersect(Target.Cells, Range("B8:B228")) Is Nothing Then
If Target.Offset(0, 9).Value = "No" Then UserForm1.Show
End If
End Sub

If the cells (B8:B228) may be entered in groups then a modification will
need to be made - perhaps a For Loop - to accomplish the same. Let me know
if you need help with that.

Mike


"Dan N" wrote:

I have a shared file where people enter a number in column B8 through 228. In
column K8 through 228 are formulas that look at the numbers in column B and
deliver a "Yes" or a "No." I want Excel to show user-form1 whenever a formula
delivers a "No." When the user-form is displayed, the user will click the OK
button to close the user form and allow the next user to repeat the process.

I'm really spinning my wheels on this. Your help would be greatly appreciated!
Thanks in advance. - DN

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
displaying the user form data cyzax7 via OfficeKB.com Excel Programming 3 June 12th 06 01:49 AM
Problem displaying a calculation result in a user form AndyRoo Excel Programming 2 November 24th 05 09:45 PM
How to: User Form to assign a user defined range to a macro variab TrevTrav Excel Programming 1 March 22nd 05 07:57 PM
Displaying part of a sheet on a user form Phillip[_4_] Excel Programming 1 January 15th 04 04:20 AM


All times are GMT +1. The time now is 08:13 AM.

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

About Us

"It's about Microsoft Excel"