ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   show the x and y of a cell (https://www.excelbanter.com/excel-discussion-misc-queries/187890-show-x-y-cell.html)

Wu

show the x and y of a cell
 
I have written a macro that the cursor will stop at uncertain cell everytime
finally.

when the cursor stop, I would like to show the x and y of the cell at
range("A1")

For example, after running the marco, the cursor stop at range("C3")

I want that in range("A1") will show -------- 3,3
if cursor stops at range("B2"), the range("A1") will show --------- 2,2

Dave Peterson

show the x and y of a cell
 
Is that row,column?

If yes, you could use:

dim myCell as range
....
with activesheet
set mycell = .cells(33, 11) 'however your macro stops????
with .range("a1")
.numberformat = "@" 'text
.value = mycell.row & "," & mycell.column
end with
end with

Wu wrote:

I have written a macro that the cursor will stop at uncertain cell everytime
finally.

when the cursor stop, I would like to show the x and y of the cell at
range("A1")

For example, after running the marco, the cursor stop at range("C3")

I want that in range("A1") will show -------- 3,3
if cursor stops at range("B2"), the range("A1") will show --------- 2,2


--

Dave Peterson


All times are GMT +1. The time now is 11:00 PM.

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