View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Ardus Petus Ardus Petus is offline
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.