Sort Based off of an Input Box

  • Thread starter Thread starter Nathan Bell
  • Start date Start date
N

Nathan Bell

All,

In trying to finish off this macro and I am trying to find a way to do a
sort on a range. The column that I am sorting by is always teh same, but
the range will vary. Is there a way in VBA to pass along that range
variable to sort? I would ideally like the input box to be where you can
click the box on the right to select your own range from within excel and it
will populate that range automatically. Then that range would be passed
along to the sort macro. Any help would be greatly appreciated.

Nathan Bell
 
All I really want to do is make the following Range("A6:G84").Select user
definable with teh input box that allows you to select the range from within
excel.
 
Use Application.Inputbox, with Type:=8

On Error Resume Next
Set rng = Application.Inputbox("Select range",Type:=8)
If Not rng Is Nothing Then
rng.Sort
'etc.

The user would then use the mouse to select the range, or type it in the
editbox, and this is returned as a range object.

--

HTH

RP
(remove nothere from the email address if mailing direct)
 

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

Back
Top