Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,327
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default 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
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
Selecting multiple cells, I can't see the cells highlighted ET Excel Discussion (Misc queries) 1 August 1st 08 03:20 PM
How to change shade of cells when selecting multiple cells abrummet Excel Discussion (Misc queries) 3 September 6th 07 11:42 AM
By selecting cells adjacent to cells tally sheet tom Excel Worksheet Functions 2 September 20th 06 07:09 PM
selecting cells Chris Excel Discussion (Misc queries) 3 July 17th 06 09:58 PM
selecting cells ynissel Excel Discussion (Misc queries) 4 July 26th 05 08:06 PM


All times are GMT +1. The time now is 10:20 AM.

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

About Us

"It's about Microsoft Excel"