Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() Hi. What I would like to do is retrieve the cells, using the Worksheet_Change Event. The question is that I only want to retrieve those cells that are from a determined range I want to work(B1:E5 for example) I do a: *For Each Range In Range(Target.Address)*, the problem is that this returns every cell changed on the Worksheet, but I don't know how to determine if the cells are on the B1:E5 range. Any help? EDIT:: In other words, what I need to do is something like: Is this single cell part of this range? Is Cells(3, 3) into Range("B1:B5")? -- baldomero ------------------------------------------------------------------------ baldomero's Profile: http://www.excelforum.com/member.php...o&userid=25680 View this thread: http://www.excelforum.com/showthread...hreadid=401820 |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi Baldomero,
Try something like: '======================== Private Sub Worksheet_Change(ByVal Target As Range) Dim rng As Range Set rng = Range("B1:B5") If Not Intersect(Target, rng) Is Nothing Then 'Do something, e.g.: MsgBox Target.Address Else 'Do nothing End If End Sub '<<======================== --- Regards, Norman "baldomero" wrote in message ... Hi. What I would like to do is retrieve the cells, using the Worksheet_Change Event. The question is that I only want to retrieve those cells that are from a determined range I want to work(B1:E5 for example) I do a: *For Each Range In Range(Target.Address)*, the problem is that this returns every cell changed on the Worksheet, but I don't know how to determine if the cells are on the B1:E5 range. Any help? EDIT:: In other words, what I need to do is something like: Is this single cell part of this range? Is Cells(3, 3) into Range("B1:B5")? -- baldomero ------------------------------------------------------------------------ baldomero's Profile: http://www.excelforum.com/member.php...o&userid=25680 View this thread: http://www.excelforum.com/showthread...hreadid=401820 |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() Ok, thanks, it seems good for me, I'll try to implement with that, thanks! -- baldomero ------------------------------------------------------------------------ baldomero's Profile: http://www.excelforum.com/member.php...o&userid=25680 View this thread: http://www.excelforum.com/showthread...hreadid=401820 |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() This is exactly what I was looking for: -------------------------------------------------------------------------- Dim Rang2 As Range Dim rang As Range Set rang = Range("B1:D15") If Not Intersect(Target, rang) Is Nothing Then For Each Rang2 In Target If Not Intersect(rang, Rang2) Is Nothing Then MsgBox (Rang2.Address) End If Next End If -------------------------------------------------------------------------- I could not have done this code without your help, thanks -- baldomer ----------------------------------------------------------------------- baldomero's Profile: http://www.excelforum.com/member.php...fo&userid=2568 View this thread: http://www.excelforum.com/showthread.php?threadid=40182 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Retrieve last non zero value in a range of cells | New Users to Excel | |||
Need to do the sum of a range+individual cells: (B2:B9)+B15=(B19:B | New Users to Excel | |||
convert a range of cells into individual worksheets? | Excel Discussion (Misc queries) | |||
Sum Array Range & Individual Cells | Excel Discussion (Misc queries) | |||
Retrieve value from a range of cells | Excel Worksheet Functions |