Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
I write a macro to find a pair of data at different cells in a worksheet.
After finding, I would like to get the x of the cells or Y of the cells.......... for example, the found data at cells(2,2) and cells(3,4) I want to write a macro to get the 2 and 3 , L1 = x of cells 1 L2 = x of cells 2 Can I use function to get the loacation of the cells ? How to write in macro to get the x or y , or x and y of a cell? |
#2
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Here is an example with one cell andone value. Let's say we are looking for
"happiness": Sub findit() v = "happiness" For Each r In ActiveSheet.UsedRange If r.Value = v Then x = r.Row y = r.Column MsgBox ("happiness can be found in cell(" & x & "," & y & ")") End If Next End Sub -- Gary''s Student - gsnu200786 "Wu" wrote: I write a macro to find a pair of data at different cells in a worksheet. After finding, I would like to get the x of the cells or Y of the cells.......... for example, the found data at cells(2,2) and cells(3,4) I want to write a macro to get the 2 and 3 , L1 = x of cells 1 L2 = x of cells 2 Can I use function to get the loacation of the cells ? How to write in macro to get the x or y , or x and y of a cell? |
#3
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
....or
If r.Value = v Then MsgBox r.Address End If |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Problem when navigating between cells | Excel Discussion (Misc queries) | |||
Problem with clicking on cells | Excel Discussion (Misc queries) | |||
Problem with Blank cells | Excel Discussion (Misc queries) | |||
Help me! There is problem with cells view... | Excel Discussion (Misc queries) | |||
problem with cells | Excel Discussion (Misc queries) |