View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Luke M Luke M is offline
external usenet poster
 
Posts: 2,722
Default Range - using in code

You'll need to use event coding. Right-click on sheet tab, view code. This
one will activate upon cell selection.
'========
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Intersect(Target, Range("F5:F12")) Is Not Nothing Then
'What you want to happen under condition 1
Call Macro1
End If
If Intersect(Target, Range("F13:F26")) Is Not Nothing Then
'What you want to happen under condition 2
Call Macro2
End If
End Sub
'========

OR, if you want to make it so that user has to double click (can lead to
less annoyance) change title to:

Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As
Boolean)

--
Best Regards,

Luke M
*Remember to click "yes" if this post helped you!*


"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