Thread: Easier way?
View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Jim Rech Jim Rech is offline
external usenet poster
 
Posts: 2,718
Default Easier way?

There is no shortcut to finding the range the active cell is in, so you're
basically going about it the way you have to.

--
Jim
"Ernst Guckel" wrote in message
...
| Hello,
|
| In my worksheet_change event I test to make sure that 'Target' is within
a
| certain range but I have many ranges that it could be in. Is there an
easier
| way then using multiple if...then statements?
|
| Ex:
|
| Private Sub Worksheet_Change(ByVal Target As Range)
|
| If Not Intersect(Range("curYear"), Target) Is Nothing Then
| dOld = Range("curMonth").Value
| Range("curMonth").Value = Month(dOld) & "/1/" & Target.Value
| Reload
| GoTo Done
| End If
| If Not Intersect(Range("curMonth"), Target) Is Nothing Then
| Reload
| GoTo Done
| End If
| If Not Intersect(Range("DayData"), Target) Is Nothing Then
| GoTo DayData
| End If
| If Not Intersect(Range("MonthData"), Target) Is Nothing Then
| GoTo MonthData
| End If
| If Not Intersect(Range("WeekData"), Target) Is Nothing Then
| GoTo WeekData
| End If
|
| There are more... Might there be an easier way?
|
| Ernst.
|