Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
selecting cells
hi
I have need to select two columns from a spreadsheet, I don't know how long these columns are going to be until runtime. I would like to be able to select this at run time so I can write out to a text file. I am able to get the last value in one column by using range and intersect. And the other one this way too, so with this I should be able to work out the cordinates for my selection area. this seems a liitle long winded, does anyone else out there have a better way of doing this? thx -Philip |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
selecting cells
Hi Philip
See if this is of help. It does contain Intersect cose, so you may not like it. Sub TestSelect() Dim C As Range, R As Range On Error Resume Next Set C = Application.InputBox _ ("Click some column headers please:", Type:=8) If C Is Nothing Then Exit Sub Set R = Intersect(C, ActiveSheet.UsedRange) R.Select MsgBox Selection.Address & " is pretty tonight." End Sub -- HTH. Best wishes Harald Followup to newsgroup only please. wrote in message om... hi I have need to select two columns from a spreadsheet, I don't know how long these columns are going to be until runtime. I would like to be able to select this at run time so I can write out to a text file. I am able to get the last value in one column by using range and intersect. And the other one this way too, so with this I should be able to work out the cordinates for my selection area. this seems a liitle long winded, does anyone else out there have a better way of doing this? thx -Philip |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
selecting cells
"Harald Staff" wrote in message ...
Hi Philip See if this is of help. It does contain Intersect cose, so you may not like it. Sub TestSelect() Dim C As Range, R As Range On Error Resume Next Set C = Application.InputBox _ ("Click some column headers please:", Type:=8) If C Is Nothing Then Exit Sub Set R = Intersect(C, ActiveSheet.UsedRange) R.Select MsgBox Selection.Address & " is pretty tonight." End Sub -- HTH. Best wishes Harald Followup to newsgroup only please. wrote in message om... hi I have need to select two columns from a spreadsheet, I don't know how long these columns are going to be until runtime. I would like to be able to select this at run time so I can write out to a text file. I am able to get the last value in one column by using range and intersect. And the other one this way too, so with this I should be able to work out the cordinates for my selection area. this seems a liitle long winded, does anyone else out there have a better way of doing this? thx -Philip thx, that did it at the end! |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Selecting multiple cells, I can't see the cells highlighted | Excel Discussion (Misc queries) | |||
How to change shade of cells when selecting multiple cells | Excel Discussion (Misc queries) | |||
By selecting cells adjacent to cells tally sheet | Excel Worksheet Functions | |||
selecting cells | Excel Discussion (Misc queries) | |||
selecting cells | Excel Discussion (Misc queries) |