Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I'm using a macro to allow a user to design a form, part of the macro
is thus: sLeft = Selection.Item(1).Address sRight = Selection.Item(Selection.Count).Address iTotalcells = Selection.Count sRange = sLeft + ":" + sRight What I need to do is work out the x and y coordinates of the upper left cell that the user is selecting, so "A1" would be x =1 and y =1 while "C6" would be x = 3 and y = 6 and so on. How can I do that? Thanks for any assistance. |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Range("a1").Row
Range("a1").column NickHK wrote in message oups.com... I'm using a macro to allow a user to design a form, part of the macro is thus: sLeft = Selection.Item(1).Address sRight = Selection.Item(Selection.Count).Address iTotalcells = Selection.Count sRange = sLeft + ":" + sRight What I need to do is work out the x and y coordinates of the upper left cell that the user is selecting, so "A1" would be x =1 and y =1 while "C6" would be x = 3 and y = 6 and so on. How can I do that? Thanks for any assistance. |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Thanks, that solved my problem.
|
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Why do you build that formula manuall
sLeft = Selection.Item(1).Address sRight = Selection.Item(Selection.Count).Address iTotalcells = Selection.Count sRange = sLeft + ":" + sRight could be replaced with sRange = Selection.Address You are using a fairly advanced technique to break out information which you reassemble back to the original information. to further illustrate. if selection.Areas.count = 1 then yTop = selection(1).Row xLeft = selection(1).coluimn yBottom = selection(selection.count).Row xRight = selection(selection.count).column end if -- Regards, Tom Ogilvy " wrote: Thanks, that solved my problem. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Combobox item selection+pop up list | Excel Programming | |||
How to Auto-populate cell based on selection of a list item | Excel Discussion (Misc queries) | |||
How do I make Microsoft Query a menu item? | Excel Discussion (Misc queries) | |||
data selection query no2 | Excel Programming |