Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
sort by name when user selects name on another worksheet | Excel Discussion (Misc queries) | |||
Need an input box when user selects a value in a drop down box | Excel Worksheet Functions | |||
pause macro until user selects correct range | Excel Programming | |||
Make Sure User Selects 3 Cells | Excel Programming | |||
User selects a range | Excel Programming |