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.
>
|