Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
In VBA it would be
Selection.Item(selection.Count) from the immediate window: ? selection.Address $C$6:$F$16 ? selection.Item(selection.count).Address $F$16 for a single range/area, the selection or range will always be left to right and top to bottom, regardless of how the user made the selection. -- Regards, Tom Ogilvy "gnosis" wrote in message ... Sorry if i was not clear..I'm talking about a single selection, with only one stroke, one rectangle... actually i'm woking on delphi application and i use a XLSContainer component with all objects,methods and properties from EXCEL-VBA...XLSContainer displays some EXCEL file that is loaded on FormShow... .finnaly i need to access all the cells from a single selection made by a client(by some buttonclick-event or whatever) and put the values from the cells in a database.. So far i manage to get the number of columns and rows in the selection by these methods: XLSContainer1.Application.ActiveWindow.RangeSelect ion.Columns.Count XLSContainer1.Application.ActiveWindow.RangeSelect ion.Rows.Count and coordinates of the first cell in the selection XLSContainer1.Application.ActiveCell.Column XLSContainer1.Application.ActiveCell.Row the problem is that i cannot predict the direction of the selection: there are four possibilities: - to select from left to right,up to down - to select from rigt to left, up to down - to select from left to right, down to up - to select from right to left, down to up if i could get the coordinates of the most distant cell from the first activCell in the selection i will know about the direction of the movement of the client. I can get these values in VB editor with some VB macro like If TypeName(Selection) < "Range" Then Exit Sub For Each cell In Selection cell.Activate ..some code Next cell but it's usles in delphi if anybody have an idea i would be greatfull Thanx so far!!! -- gnosis ------------------------------------------------------------------------ gnosis's Profile: http://www.excelforum.com/member.php...o&userid=16806 View this thread: http://www.excelforum.com/showthread...hreadid=320055 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Excel sheet: selection of cell or rows not visible. | Excel Worksheet Functions | |||
Problem seeing and accessing top of sheet | Excel Discussion (Misc queries) | |||
Cell selection in non-active sheet | Excel Programming | |||
Capture listbox selection to a cell in a different sheet | Excel Programming | |||
Accessing a textbox on a sheet.... | Excel Programming |