+ Reply to Thread
Results 1 to 10 of 10

Code required to order data in a table when a button is clicked

  1. #1
    Forum Contributor
    Join Date
    05-14-2015
    Location
    West Yorkshire
    MS-Off Ver
    10
    Posts
    130

    Code required to order data in a table when a button is clicked

    Hi, I need help to arrange the data in the table by increasing thickness ("INPUT" sheet column "F"). I need all the corresponding information from columns B,C,D,E, & H to be moved in order with their original thickness in column F. I hope this makes sense

    Any help would be much appreciated.

    Thanks,
    Jeremy
    Attached Files Attached Files

  2. #2
    Forum Expert Arkadi's Avatar
    Join Date
    02-13-2014
    Location
    Smiths Falls, Ontario, Canada
    MS-Off Ver
    Office 365
    Posts
    5,059

    Re: Code required to order data in a table when a button is clicked

    Hi CPAC (Jeremy),

    I noticed you do have a header for column A, so you may need to adjust the code if you want that included, but I went by the specs you provided:

    Please Login or Register  to view this content.
    Please help by:

    Marking threads as closed once your issue is resolved. How? The Thread Tools at the top
    Any reputation (*) points appreciated. Not just by me, but by all those helping, so if you found someone's input useful, please take a second to click the * at the bottom left to let them know

    There are 10 kinds of people in this world... those who understand binary, and those who don't.

  3. #3
    Forum Contributor
    Join Date
    05-14-2015
    Location
    West Yorkshire
    MS-Off Ver
    10
    Posts
    130

    Re: Code required to order data in a table when a button is clicked

    Perfect . Any idea how I can stop it jumbling the grey white line colours when it does the order?

  4. #4
    Forum Expert Arkadi's Avatar
    Join Date
    02-13-2014
    Location
    Smiths Falls, Ontario, Canada
    MS-Off Ver
    Office 365
    Posts
    5,059

    Re: Code required to order data in a table when a button is clicked

    I assume you manually coloured the rows?
    If you format as table instead, then it will work, except all the blanks end up on top.
    Perhaps in this case it would be best to apply conditional formatting to colour the rows in alternating fashion, that way the sort will maintain colouring.
    A post detailing that (quite old but applicable) can be found here

  5. #5
    Forum Contributor
    Join Date
    05-14-2015
    Location
    West Yorkshire
    MS-Off Ver
    10
    Posts
    130

    Re: Code required to order data in a table when a button is clicked

    That's great, thank you for the help.

  6. #6
    Forum Expert Arkadi's Avatar
    Join Date
    02-13-2014
    Location
    Smiths Falls, Ontario, Canada
    MS-Off Ver
    Office 365
    Posts
    5,059

    Re: Code required to order data in a table when a button is clicked

    Glad I could help
    Thanks for the rep and the feedback, please remember to mark the thread as solved if you are satisfied? Thanks!

  7. #7
    Forum Contributor
    Join Date
    05-14-2015
    Location
    West Yorkshire
    MS-Off Ver
    10
    Posts
    130

    Re: Code required to order data in a table when a button is clicked

    Hi I've progressed a little further with my project. The only problem is depending on the number of entries all the data is moved to the bottom of the table. any ideas? Any help would be appreciated?

    I've attached the file so you can see.
    Attached Files Attached Files

  8. #8
    Forum Expert Arkadi's Avatar
    Join Date
    02-13-2014
    Location
    Smiths Falls, Ontario, Canada
    MS-Off Ver
    Office 365
    Posts
    5,059

    Re: Code required to order data in a table when a button is clicked

    Did you use "format as table" to fix the colour problem, or conditional formatting?
    Format as table gave me the same issue which is why I mentioned the conditional formatting option.

  9. #9
    Forum Contributor
    Join Date
    05-14-2015
    Location
    West Yorkshire
    MS-Off Ver
    10
    Posts
    130

    Re: Code required to order data in a table when a button is clicked

    Hi, yes I used "format as table". I've now followed the link you provided originally and used conditional formatting - Perfect! Thanks again for all the help and support with this one.

  10. #10
    Forum Expert Arkadi's Avatar
    Join Date
    02-13-2014
    Location
    Smiths Falls, Ontario, Canada
    MS-Off Ver
    Office 365
    Posts
    5,059

    Re: Code required to order data in a table when a button is clicked

    My pleasure

    Still trying to figure out how to make this work with the format as table method.

+ 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. Code Works only in Debug Mode, Not When Button is Clicked.
    By shaht96 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 07-17-2018, 05:11 PM
  2. [SOLVED] VBA code to show updated data in the listbox after the data is entered and button clicked
    By chin67326 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 12-25-2015, 04:23 AM
  3. Table on the basis of raw data..Code REquired..
    By kundanlal in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 03-18-2015, 10:10 AM
  4. [SOLVED] VBA Code to add numbers when a button is clicked
    By ISUCyclones in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 06-14-2012, 12:25 PM
  5. Code for Button to Submit Data to List in Numerical and Chronological Order
    By swordswinger710 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 01-13-2012, 01:20 AM
  6. Run code whenever any radio button is clicked
    By rwalk9sr in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-07-2007, 06:01 PM
  7. [SOLVED] Code needed to test if user clicked a button
    By Subs in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-26-2005, 10:05 AM

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