Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Capture the range a user selects and put in textbox.

Hi,
I am trying to capture the range a user selects then put that
information into a textbox in a userform. That's the start cell and
end cell addresses, not the contents.

I have a Userform with an Excel workbook. The user is going to
highlight a range of cells in any worksheet in any workbook () and I
want the following details to be shown in text-boxes in my Userform.
The data I need is:

Workbook Name
Worksheet Name
First Cell of the range selected
Last Cell of the range selected.

Does anyone have any ideas? I thought there would be some way of
converting a Range to a String, but I didn't very far down that route.

Thanks in advance!
Drew.

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 789
Default Capture the range a user selects and put in textbox.

Hi

sub test()
dim start as string, finish as string
With Selection
start = .Cells(1,1).address is the first cell
finish = .Cells(.rows.count, .columns.count).address
End With
msgbox start
msgbox finish

end sub

regards
Paul

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 718
Default Capture the range a user selects and put in textbox.

tbWB.Value = Selection.parent.Parent.Name
tbWS.Value = Selection.Parent.Name
tbFirstCell.Value = Selection(1).Address
tbLastCell.Value = Selection(Selection.Count).Address

HTH
--
AP

"Drew" a écrit dans le message de
ups.com...
Hi,
I am trying to capture the range a user selects then put that
information into a textbox in a userform. That's the start cell and
end cell addresses, not the contents.

I have a Userform with an Excel workbook. The user is going to
highlight a range of cells in any worksheet in any workbook () and I
want the following details to be shown in text-boxes in my Userform.
The data I need is:

Workbook Name
Worksheet Name
First Cell of the range selected
Last Cell of the range selected.

Does anyone have any ideas? I thought there wtould be some way of
converting a Range to a String, but I didn't very far down that route.

Thanks in advance!
Drew.



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
sort by name when user selects name on another worksheet Mathew Excel Discussion (Misc queries) 2 March 2nd 10 02:24 PM
Need an input box when user selects a value in a drop down box Susan Excel Worksheet Functions 4 September 8th 08 06:14 PM
pause macro until user selects correct range JCIrish Excel Programming 6 March 18th 06 09:26 PM
Make Sure User Selects 3 Cells Steve[_60_] Excel Programming 3 June 8th 04 06:40 AM
User selects a range Wesley[_2_] Excel Programming 2 January 25th 04 09:06 PM


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

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

About Us

"It's about Microsoft Excel"