Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default Sort Based off of an Input Box

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


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default Sort Based off of an Input Box

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.

"Nathan Bell" wrote in message
...
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




  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Sort Based off of an Input Box

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)


"Nathan Bell" wrote in message
...
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.

"Nathan Bell" wrote in message
...
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






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
How to input pictures automatically based on cell input? bsharp Excel Worksheet Functions 9 May 30th 09 07:16 AM
run macro with input msg based on cell input Janelle S Excel Discussion (Misc queries) 0 January 20th 08 05:23 AM
I would like to sort a work sheet based upon user input value,(dat John Bundy Excel Worksheet Functions 0 November 30th 06 04:18 PM
I would like to sort a work sheet based upon user input value,(dat A1CaddMan Excel Worksheet Functions 0 November 29th 06 03:53 PM
CODE to select range based on User Input or Value of Input Field Sandi Gauthier Excel Programming 4 December 8th 03 03:22 PM


All times are GMT +1. The time now is 12:11 PM.

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"