View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Bob Phillips[_6_] Bob Phillips[_6_] is offline
external usenet poster
 
Posts: 11,272
Default Referencing cells to VB

Private Sub Worksheet_Change(ByVal Target As Range)

On Error GoTo ws_exit:
Application.EnableEvents = False
If Not Intersect(Target, Me.Range("A1:H10")) Is Nothing Then
With Target
If .Value = "M" Then
userfcorm1.Show
End If
End With
End If

ws_exit:
Application.EnableEvents = True
End Sub

'This is worksheet event code, which means that it needs to be
'placed in the appropriate worksheet code module, not a standard
'code module. To do this, right-click on the sheet tab, select
'the View Code option from the menu, and paste the code in.



--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"CTInt04" wrote in message
...
Problem:

I am trying to reference cells on a worksheet that is below the main data

in the worksheet. When a cell with "M" in it is clicked, a userform appears
that should displays the hours in a txtbox that correspond to that date and
that person. The hours are referenced from the info below in rows 7-10.


Worksheet:
A B C D E
1 Bill Tom Tim Kim
2 7/1 M J F M
3 7/2 N F J S
4 7/3 F M S S
5
6
7 7/1 4 2
8 7/3 3
9
10


Please help!!! And give suggestions. thanx.
- CDotWin