ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Value at Intersecting cells (https://www.excelbanter.com/excel-programming/275423-re-value-intersecting-cells.html)

Chip Pearson

Value at Intersecting cells
 
I'm not sure what you're looking for -- there is no intersection with cells
B8 and D8. You might be interested in the Application.Intersect method.
E.g.,

Dim R1 As Range
Dim R2 As Range
Dim ISect As Range
Set R1 = Range("A1")
Set R2 = Range("A1:C3")
Set ISect = Application.Intersect(R1, R2)
If ISect Is Nothing Then
Debug.Print "No overlapping cells"
Else
Debug.Print "Cell " & ISect.Address & " Value: " & ISect.Value
End If


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
www.cpearson.com



"ibeetb" wrote in message
...
Is there a way to get the value of a cell which lies at the intersection

of
say......B8 and D8? (I'd prefer to do in code - but will accept doing it

in
a wrksht function)

Thanks






All times are GMT +1. The time now is 09:37 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com