+ Reply to Thread
Results 1 to 7 of 7

Code for selection of range by user

  1. #1
    Registered User
    Join Date
    01-16-2018
    Location
    Hong Kong
    MS-Off Ver
    2013
    Posts
    3

    Code for selection of range by user

    Hi,

    I have following Code in a macro

    Please Login or Register  to view this content.
    In this currently the sort range and each collumn range is fixed but I would like to replace it by a user selectable range. What code I should insert.

    thanks
    Last edited by sacash; 01-16-2018 at 02:47 AM.

  2. #2
    Forum Guru xlnitwit's Avatar
    Join Date
    06-27-2016
    Location
    London
    MS-Off Ver
    Windows: 2010; Mac: 16.13 (O365)
    Posts
    7,085

    Re: Code for selection of range by user

    Hi

    Please fix your closing tag before we can assist you. It should be a [/CODE] tag and not [END CODE].
    Don
    Please remember to mark your thread 'Solved' when appropriate.

  3. #3
    Forum Guru xlnitwit's Avatar
    Join Date
    06-27-2016
    Location
    London
    MS-Off Ver
    Windows: 2010; Mac: 16.13 (O365)
    Posts
    7,085

    Re: Code for selection of range by user

    Thanks.

    You can use Application.inputbox(type:=8) to allow the user to select a range.

  4. #4
    Registered User
    Join Date
    01-16-2018
    Location
    Hong Kong
    MS-Off Ver
    2013
    Posts
    3

    Re: Code for selection of range by user

    and how will it change the code posted above?

  5. #5
    Forum Guru xlnitwit's Avatar
    Join Date
    06-27-2016
    Location
    London
    MS-Off Ver
    Windows: 2010; Mac: 16.13 (O365)
    Posts
    7,085

    Re: Code for selection of range by user

    That depends on how you decide which columns to sort by.

  6. #6
    Registered User
    Join Date
    01-16-2018
    Location
    Hong Kong
    MS-Off Ver
    2013
    Posts
    3

    Re: Code for selection of range by user

    all the columns which are stated in the code needs to be sorted from high to low. but range will be user selected by Input box

  7. #7
    Forum Guru xlnitwit's Avatar
    Join Date
    06-27-2016
    Location
    London
    MS-Off Ver
    Windows: 2010; Mac: 16.13 (O365)
    Posts
    7,085

    Re: Code for selection of range by user

    So you'll need to validate the selected range first to ensure it actually includes columns H to N as a minimum?

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Dynamic Range, based on user selection, used with FOR LOOP
    By ericbartha in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 07-01-2015, 05:08 PM
  2. Replies: 0
    Last Post: 12-10-2014, 11:30 AM
  3. Long range calendar with changing color based on user selection
    By jrholden in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 12-31-2013, 04:51 PM
  4. Issue with range selection within user form
    By AndrewWheeler87 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 01-23-2013, 03:05 PM
  5. Looking to code combo/drop down list user selection and display formula results
    By toddbailey in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 02-07-2012, 06:17 PM
  6. Error on code to copy and paste user selection.
    By leaning in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 11-03-2011, 10:52 AM
  7. With Selection Input Cell Value or Range into User Form
    By bdb1974 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 03-04-2010, 05:36 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1