Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default User selection

Hi Everyone,
Need some help to finish a project. The procedure requests
user to select a column in a worksheet by either selecting
the entire column or just selecting a single cell in that
column. The idea is that once selection is made, data
would be generated from that column. However, I am not
sure how do I determine which column in the work sheet was
selected by the user. Any help is appreciated. Thanks in
advance.

  #2   Report Post  
Posted to microsoft.public.excel.programming
rog rog is offline
external usenet poster
 
Posts: 39
Default User selection

Try something like this :

Set rngSelection = Application.InputBox( _
Prompt:="Select cell(s) (use CTRL key to select
more than one)", _
Title:="your title", _
Default:=ActiveCell.Address, _
Type:=8)

this will return a range object after the user has
selected something

Rgds

Rog



-----Original Message-----
Hi Everyone,
Need some help to finish a project. The procedure

requests
user to select a column in a worksheet by either

selecting
the entire column or just selecting a single cell in that
column. The idea is that once selection is made, data
would be generated from that column. However, I am not
sure how do I determine which column in the work sheet

was
selected by the user. Any help is appreciated. Thanks in
advance.

.

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default User selection

ActiveCell.Column

--
Regards,
Tom Ogilvy

"Samir" wrote in message
...
Hi Everyone,
Need some help to finish a project. The procedure requests
user to select a column in a worksheet by either selecting
the entire column or just selecting a single cell in that
column. The idea is that once selection is made, data
would be generated from that column. However, I am not
sure how do I determine which column in the work sheet was
selected by the user. Any help is appreciated. Thanks in
advance.



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default User selection

Samir,

If you want just the column number, use code like

Dim ColNum As Integer
ColNum = ActiveCell.Column

If you want a Range reference to the column, use

Dim ColRng As Range
Set ColRng = ActiveCell.EntireColumn
' or
Set ColRng = Application.Intersect(ActiveSheet.UsedRange,
ActiveCell.EntireColumn)


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com



"Samir" wrote in message
...
Hi Everyone,
Need some help to finish a project. The procedure requests
user to select a column in a worksheet by either selecting
the entire column or just selecting a single cell in that
column. The idea is that once selection is made, data
would be generated from that column. However, I am not
sure how do I determine which column in the work sheet was
selected by the user. Any help is appreciated. Thanks in
advance.



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
Pivot Table limiting user selection PJS Excel Discussion (Misc queries) 2 April 29th 10 06:33 PM
VBA Code User Range Selection jimbo Excel Discussion (Misc queries) 5 January 5th 10 02:31 AM
Displaying a result based on user selection Emma Excel Discussion (Misc queries) 3 June 9th 09 08:08 PM
Calculate average based on user selection William Excel Discussion (Misc queries) 2 January 16th 07 06:16 PM
Generate a value from user selection in list box. Sol Excel Discussion (Misc queries) 2 September 8th 06 09:03 PM


All times are GMT +1. The time now is 07:33 PM.

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"