Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default How to find the cell given x and y worksheet coordinates

I know how to find .top and .right of a given cell

Does someone know if the opposite is doable

Thanks a lot. Stefano
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 132
Default How to find the cell given x and y worksheet coordinates

Hi Stefano;

One idea might be to take the top and the take the
measurement for the activecell.row and column width and
height and add them to the top. This would give you the
the other values.

Thanks,

Greg


-----Original Message-----
I know how to find .top and .right of a given cell.

Does someone know if the opposite is doable?

Thanks a lot. Stefano
.

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 63
Default How to find the cell given x and y worksheet coordinates

Hi Stefano;
With ActiveCell
MsgBox "Cell :" & vbTab & .Address(False, False) _
& vbLf & "Top :" & vbTab & .Top & vbLf _
& "Right :" & vbTab & .Offset(0, 1).Left
End With

MP

"Stefano Gatto" a écrit dans le message de
...
I know how to find .top and .right of a given cell.

Does someone know if the opposite is doable?

Thanks a lot. Stefano



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default How to find the cell given x and y worksheet coordinates

Sorry guys, but I deduct from your replies that I definitely did not express myself clearly enough. Sorry. Here I try again

For a given (or known) cell, I can find the x and y coordinates by invoking the .left and .top properties of the range. Typically this is

x=thisworkbook.worksheets(1).cells(10,10).lef
y=thisworkbook.worksheets(1).cells(10,10).to

What I need is the opposite i.e. find the range object, given 2 integers that represent the x and y in the same units as are expressed .left and .top above. Do you know how to find that 1-cell range object given those x and y?
  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 201
Default How to find the cell given x and y worksheet coordinates

Stefano
It is not clear what you want. When you say "the x and y coordinates"
do you mean the column number and the row number? When you say you want to
"find the cell", what do you want? Do you want that cell selected? Do you
want just the cell address? Post back with a clearer explanation of what
you want. For instance, give an example of the coordinates and what you
want to happen/see. HTH Otto
"Stefano Gatto" wrote in message
...
I know how to find .top and .right of a given cell.

Does someone know if the opposite is doable?

Thanks a lot. Stefano





  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default How to find the cell given x and y worksheet coordinates

Thanks Otto for your interest to better understand my problem.

Vic Eldridge replied to another of my posts above and told me to use the
TopLeftCell property and this is what I needed.

I wanted to implement a function returning the range object of the cell
where a botton has its upper left corner, when given by its name (like the
string "Button 1" for example).

For example: imagine there is a button named "Button 1" and having its top
left corner in cell B10, I wanted a function returning the range object of
cell B10, when given "Button 1" as parameter.

This would allow me to create a button and attach a macro to it that writes
the current time (Now) on the cell where the button itself is located. Then
I can copy and paste this cell (and the button that goes with it) how many
times I want, by preserving the button's capability to write to the cell
where the new button is pasted... I hope this time I am clear.

Thanks and have a nice day.

Stefano

PS: I made the mistake below to mention .right - I actually meant .left




"Otto Moehrbach" wrote in message
...
Stefano
It is not clear what you want. When you say "the x and y coordinates"
do you mean the column number and the row number? When you say you want

to
"find the cell", what do you want? Do you want that cell selected? Do

you
want just the cell address? Post back with a clearer explanation of what
you want. For instance, give an example of the coordinates and what you
want to happen/see. HTH Otto
"Stefano Gatto" wrote in message
...
I know how to find .top and .right of a given cell.

Does someone know if the opposite is doable?

Thanks a lot. Stefano





  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default How to find the cell given x and y worksheet coordinates

Something like this is independent from the button name, so you can have it
calle by any button, but it will set the rngcell to the cell where the
pressed button resides:

set
rngCell=thisworkbook.worksheets(1).buttons(applica tion.caller).topleftcell

Stefano


"Stefano Gatto" wrote in message
...
Thanks Otto for your interest to better understand my problem.

Vic Eldridge replied to another of my posts above and told me to use the
TopLeftCell property and this is what I needed.

I wanted to implement a function returning the range object of the cell
where a botton has its upper left corner, when given by its name (like the
string "Button 1" for example).

For example: imagine there is a button named "Button 1" and having its top
left corner in cell B10, I wanted a function returning the range object of
cell B10, when given "Button 1" as parameter.

This would allow me to create a button and attach a macro to it that

writes
the current time (Now) on the cell where the button itself is located.

Then
I can copy and paste this cell (and the button that goes with it) how many
times I want, by preserving the button's capability to write to the cell
where the new button is pasted... I hope this time I am clear.

Thanks and have a nice day.

Stefano

PS: I made the mistake below to mention .right - I actually meant .left




"Otto Moehrbach" wrote in message
...
Stefano
It is not clear what you want. When you say "the x and y

coordinates"
do you mean the column number and the row number? When you say you want

to
"find the cell", what do you want? Do you want that cell selected? Do

you
want just the cell address? Post back with a clearer explanation of

what
you want. For instance, give an example of the coordinates and what you
want to happen/see. HTH Otto
"Stefano Gatto" wrote in message
...
I know how to find .top and .right of a given cell.

Does someone know if the opposite is doable?

Thanks a lot. Stefano







  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 201
Default How to find the cell given x and y worksheet coordinates

Sorry but I can't help you with that. Hopefully someone else will respond
and help you with it. Otto
"Stefano Gatto" wrote in message
...
Something like this is independent from the button name, so you can have

it
calle by any button, but it will set the rngcell to the cell where the
pressed button resides:

set
rngCell=thisworkbook.worksheets(1).buttons(applica tion.caller).topleftcell

Stefano


"Stefano Gatto" wrote in message
...
Thanks Otto for your interest to better understand my problem.

Vic Eldridge replied to another of my posts above and told me to use the
TopLeftCell property and this is what I needed.

I wanted to implement a function returning the range object of the cell
where a botton has its upper left corner, when given by its name (like

the
string "Button 1" for example).

For example: imagine there is a button named "Button 1" and having its

top
left corner in cell B10, I wanted a function returning the range object

of
cell B10, when given "Button 1" as parameter.

This would allow me to create a button and attach a macro to it that

writes
the current time (Now) on the cell where the button itself is located.

Then
I can copy and paste this cell (and the button that goes with it) how

many
times I want, by preserving the button's capability to write to the cell
where the new button is pasted... I hope this time I am clear.

Thanks and have a nice day.

Stefano

PS: I made the mistake below to mention .right - I actually meant .left




"Otto Moehrbach" wrote in message
...
Stefano
It is not clear what you want. When you say "the x and y

coordinates"
do you mean the column number and the row number? When you say you

want
to
"find the cell", what do you want? Do you want that cell selected?

Do
you
want just the cell address? Post back with a clearer explanation of

what
you want. For instance, give an example of the coordinates and what

you
want to happen/see. HTH Otto
"Stefano Gatto" wrote in message
...
I know how to find .top and .right of a given cell.

Does someone know if the opposite is doable?

Thanks a lot. Stefano








Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
find corresponding coordinates on graph KJ Charts and Charting in Excel 1 March 13th 09 01:51 PM
how to find coordinates in excel graph golden friend Charts and Charting in Excel 0 November 29th 06 12:29 PM
How can I use a worksheet to plot polar coordinates? louradam Charts and Charting in Excel 1 June 19th 06 04:43 PM
Using Air Coordinates in a Worksheet KalebsDad78 Excel Worksheet Functions 2 April 12th 05 06:51 AM
Converting MouseDown Coordinates to Chart Point Coordinates Steve[_50_] Excel Programming 3 December 2nd 03 06:48 PM


All times are GMT +1. The time now is 01:15 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"