+ Reply to Thread
Results 1 to 7 of 7

Editing a vba script to work with different columns

  1. #1
    Forum Contributor
    Join Date
    08-14-2014
    Location
    US
    MS-Off Ver
    2013
    Posts
    135

    Editing a vba script to work with different columns

    I tried getting help on this script on another forum and not able to get any help on it.

    I currently have a macro that works for columns 1:5

    Please Login or Register  to view this content.
    I would like to know how would I make the script work with columns 7:11 with 10 being the sortKeyCol. Here is what I tried

    Please Login or Register  to view this content.
    Not sure what I need to change in the code itself to prevent getting a run-time 9 error and make it work. Could someone lend a hand with this please.

  2. #2
    Forum Contributor Cerbera's Avatar
    Join Date
    07-06-2010
    Location
    Rotorua, New Zealand
    MS-Off Ver
    Excel 2007, 2013, 2016 & 365
    Posts
    137

    Re: Editing a vba script to work with different columns

    Could you post some sample data (doesn't have to be real info) in a spreadsheet, preferably with the macro built in?

    This will make it easier to work through.

    Thanks

  3. #3
    Forum Contributor
    Join Date
    08-14-2014
    Location
    US
    MS-Off Ver
    2013
    Posts
    135

    Re: Editing a vba script to work with different columns

    Here is stripped down version with the working and broken scripts
    https://www.dropbox.com/s/fek37xem5n...mple.xlsm?dl=0

  4. #4
    Forum Contributor
    Join Date
    08-14-2014
    Location
    US
    MS-Off Ver
    2013
    Posts
    135

    Re: Editing a vba script to work with different columns

    Could someone who has a second to look at this please let me know if this can be done simply by editing or does another script need to be wrote.

  5. #5
    Forum Expert millz's Avatar
    Join Date
    08-14-2013
    Location
    Singapore
    MS-Off Ver
    Excel, Access 2016
    Posts
    1,694

    Re: Editing a vba script to work with different columns

    Hi Bill, here is the amended version. Not sure if you need it, but I've added a sort key row. Note that the sort key row/col should be the row/col of the sort area, not row/col of the worksheet, and there's no need for "end col".

    Please Login or Register  to view this content.
    多么想要告诉你 我好喜欢你

  6. #6
    Forum Contributor
    Join Date
    08-14-2014
    Location
    US
    MS-Off Ver
    2013
    Posts
    135

    Re: Editing a vba script to work with different columns

    millz you are my HERO!!!! I love it Thank You. I can not wait to add it the sheet and try this bad boy out. When I am done adding this and doing a few more things care to see the final product?

    From a educational stand point can not wait to compare this to the old one side by to see the changes

  7. #7
    Forum Expert millz's Avatar
    Join Date
    08-14-2013
    Location
    Singapore
    MS-Off Ver
    Excel, Access 2016
    Posts
    1,694

    Re: Editing a vba script to work with different columns

    Glad I could help. If this problem is solved, please use thread tools and mark this thread solved.

    Quote Originally Posted by Mr_Bill View Post
    When I am done adding this and doing a few more things care to see the final product?
    Sure, I hope to see a form coming up

+ 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. Script doesn't work anymore (auto hide rows and columns
    By Crispy85 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-02-2013, 02:17 AM
  2. editing work schedule
    By sendtobrad in forum Excel General
    Replies: 1
    Last Post: 01-10-2010, 05:10 PM
  3. Is there a script that will work?
    By RayB in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-18-2006, 11:25 AM
  4. [SOLVED] Need help Editing Ron de Bruin Script
    By kris.king@gmail.com in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 02-28-2006, 05:45 PM
  5. Running a script while editing a cell
    By clayton in forum Excel General
    Replies: 8
    Last Post: 12-15-2005, 06:24 PM

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