Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Using
Private Sub Worksheet_Change(ByVal Target As Range) How do you select a perticular range like b5 - b15 found for a single cell but not a range |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I'm a newbie but, I used this for one of my worksheet change events. If
you have it set for a single cell. Target = Range("B5"), could you not just use Range("B5:B15") ? Dim myrow&, myCol& myrow = Target.Row myCol = Target.Column If myrow 0 And myrow < 100 Then If myCol 0 And myCol < 100 Then |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() If Not Intersect(Target,Range("B5:B15)) Is Nothing Then 'it is one of B5:B15 -- HTH RP (remove nothere from the email address if mailing direct) "Dan" wrote in message ... Using Private Sub Worksheet_Change(ByVal Target As Range) How do you select a perticular range like b5 - b15 found for a single cell but not a range |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Private Sub Worksheet_Change(ByVal Target As Range)
if Union(Target,Range("B5:B15")).Address = "$B$5:$B$15" then end if End Sub if you want to react to only a change in a single cell in the Range B5:B15 Private Sub Worksheet_Change(ByVal Target As Range) if Target.count 1 then exit sub if Not Intersect(Target,Range("B5:B15")) is nothing then end if End Sub -- Regards, Tom Ogilvy "Dan" wrote in message ... Using Private Sub Worksheet_Change(ByVal Target As Range) How do you select a perticular range like b5 - b15 found for a single cell but not a range |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Thanks for looking, got it:
Set myRange = Intersect(Range("b5:b15"), Target) If Not myRange Is Nothing Then ' your code End If Cheers "Dan" wrote: Using Private Sub Worksheet_Change(ByVal Target As Range) How do you select a perticular range like b5 - b15 found for a single cell but not a range |
#6
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Sub Worksheet_Change(ByVal Target As Excel.Range)
If Intersect(Range("A2:A10"), Target) Is Nothing Then Exit Sub Application.EnableEvents = False Target.Value = Target.Value * 0.3 Application.EnableEvents = True End Sub This looks for changes in a certain range -- Gary's Student "Dan" wrote: Using Private Sub Worksheet_Change(ByVal Target As Range) How do you select a perticular range like b5 - b15 found for a single cell but not a range |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Sub Worksheet_Change | Excel Discussion (Misc queries) | |||
Worksheet_Change DDE | Excel Programming | |||
Worksheet_Change | Excel Programming | |||
worksheet_change vs. calculate, and worksheet_change not running | Excel Programming | |||
worksheet_change vs. calculate, and worksheet_change not running | Excel Programming |