Get user selected range into RefEdit

J

J. Hall

I've created a calendar on which a teacher will select a range of
class periods (vertical cells) for which he/she wants to reserve a
laptop computer cart. When they select my custom menu item a form will
pop up with list boxes to indicate the teacher's name, room number,
and building, as well as a refedit control.

I would like to have the RefEdit control field show the range that the
teacher has already selected. (The teacher may then accept the range
that was pre-selected, or may change his/her mind to select another
range.)

The spreadsheet is called "Laptop Schedule.xls". There are 13 sheets
(one for each month and one for lists of teachers' names, room numbers
and building names for the above form.

I know only enough VBA to be quite dangerous, so please go easy!
Thanks...
 
V

Vasant Nanavati

Perhaps something like:

Private Sub UserForm_Activate()
If TypeName(Selection) = "Range" Then RefEdit1 = Selection.Address
End Sub
 
S

Steve Garman

Assuming a RefEdit called "RefEdit1", in the code for the userform, try:

Private Sub UserForm_Activate()
RefEdit1.Text = Selection.Address
End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top