Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
How to activate a User Form
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. |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
How to activate a User Form
Hi
Thy this: Private Sub UserForm_Initialize() CriteriaReached.TextBox1. _ Text = ThisWorkbook.Worksheets(1).Range("A" & ActiveCell.Row).Value End Sub Regards, Per "Rob" skrev i meddelelsen ... 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 |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Trying to get a User Form to activate off a drop down menu | Excel Discussion (Misc queries) | |||
Date field in user form & Loading a user form on opening workbook | Excel Programming | |||
Can a TextBox on a user form activate a popup calander for dat | Excel Programming | |||
Activate user form upon condition | Excel Programming | |||
Activate Excel worksheet after showing a user form ? | Excel Programming |