PC Review


Reply
Thread Tools Rate Thread

How to activate a User Form

 
 
Rob
Guest
Posts: n/a
 
      16th Mar 2010
Hi,
I would like to activate a User Form with text box when a range of values
meets specific criteria.

Assuming B3 to B26 is the active range with values and the range A3 to A26
contains text with three letters in each cell.

At the moment the code to activate the User Form looks like this:

Sub CheckVolumeRise2 ()
If ActiveCell < ActiveCell.Offset(0, 2) And ActiveCell.Offset(0, 2) < _
ActiveCell.Offset(0, 4) Then
ActiveCell.Offset(0, 2).Activate
CriteriaReached.Show
Else
ActiveCell.Offset(0, 2).Activate
End If
StartTimer
End Sub

The User Form Text Box code looks like this:

Private Sub UserForm_Initialize()
CriteriaReached.TextBox1. _
Text = ThisWorkbook.Worksheets(1).Range("a6").Value
End Sub

At the moment the User Form (named CriteriaReached) Text Box will only show
ADO which is the three letters in cell A6.

What I am trying to achieve, is that if for example, the criteria was
reached in row 13 then the User form would activate and the text in cell A13
which might be AAO would show in the text box of the User Form. Or if
multiple rows reached the criteria at the same time for example rows 9 ,12
and 25 the text box would show something like this AAI, AAM, ABV.

I would appreciate any help I can get on this.

Thank you.

 
Reply With Quote
 
 
 
 
Per Jessen
Guest
Posts: n/a
 
      16th Mar 2010
Hi

Thy this:

Private Sub UserForm_Initialize()
CriteriaReached.TextBox1. _
Text = ThisWorkbook.Worksheets(1).Range("A" & ActiveCell.Row).Value
End Sub

Regards,
Per


"Rob" <(E-Mail Removed)> skrev i meddelelsen
news:775C4C0A-4C43-4F88-A8E9-(E-Mail Removed)...
> Hi,
> I would like to activate a User Form with text box when a range of values
> meets specific criteria.
>
> Assuming B3 to B26 is the active range with values and the range A3 to A26
> contains text with three letters in each cell.
>
> At the moment the code to activate the User Form looks like this:
>
> Sub CheckVolumeRise2 ()
> If ActiveCell < ActiveCell.Offset(0, 2) And ActiveCell.Offset(0, 2) < _
> ActiveCell.Offset(0, 4) Then
> ActiveCell.Offset(0, 2).Activate
> CriteriaReached.Show
> Else
> ActiveCell.Offset(0, 2).Activate
> End If
> StartTimer
> End Sub
>
> The User Form Text Box code looks like this:
>
> Private Sub UserForm_Initialize()
> CriteriaReached.TextBox1. _
> Text = ThisWorkbook.Worksheets(1).Range("a6").Value
> End Sub
>
> At the moment the User Form (named CriteriaReached) Text Box will only
> show
> ADO which is the three letters in cell A6.
>
> What I am trying to achieve, is that if for example, the criteria was
> reached in row 13 then the User form would activate and the text in cell
> A13
> which might be AAO would show in the text box of the User Form. Or if
> multiple rows reached the criteria at the same time for example rows 9 ,12
> and 25 the text box would show something like this AAI, AAM, ABV.
>
> I would appreciate any help I can get on this.
>
> Thank you.
>

 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Trying to get a User Form to activate off a drop down menu Rcarper Microsoft Excel Misc 2 2nd Oct 2009 02:04 PM
Can a TextBox on a user form activate a popup calander for date se =?Utf-8?B?Sm9oYW5uTQ==?= Microsoft Excel Programming 2 8th Sep 2006 09:36 AM
Strange behaviour of Form.WindowState.Maximized in Form.Activate event viliamb Microsoft Dot NET Framework Forms 0 4th Jan 2006 09:01 PM
Activate user form upon condition fishergomz Microsoft Excel Programming 2 6th May 2004 03:36 PM
Activate Excel worksheet after showing a user form ? KajBre Microsoft Excel Programming 5 24th Jan 2004 03:56 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 09:39 PM.