Range - using in code
Right click the Sheet tab and view code. Paste the below code and try...You
can remove the Msgboxs
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Not Application.Intersect(ActiveCell, Range("F5:F12")) Is Nothing Then
MsgBox "Riskform"
Load UserForm1
UserForm1.Show
ElseIf Not Application.Intersect(ActiveCell, Range("F13:F26")) Is Nothing Then
MsgBox "Process form"
Load UserForm2
UserForm2.Show
End If
End Sub
If this post helps click Yes
---------------
Jacob Skaria
"Stephanie" wrote:
Hi, All! Excel coding is a whole new ball game!
I set ranges (A5:F11) as "PeopleDrivers" and range (A13:F26) as
"ProcessDrivers".
Column F is a "Click here" column that is suppose to open a form based on
code, and I hope based on the row.
I want to say if the cursor is on column F within the row range (5 through
12), open RiskForm,
if the cursor is on column F within the row range (13 through 26), open
ProcessForm.... And so on.
I don't seem to understand ActiveCell, rows, columns, ranges.... And would
appreciate your guidance.
Cheers,
Stephanie
|