+ Reply to Thread
Results 1 to 9 of 9

VBA Row Programming

  1. #1
    Registered User
    Join Date
    04-28-2010
    Location
    Los Angeles, CA
    MS-Off Ver
    Excel 2003
    Posts
    28

    VBA Row Programming

    Hello,

    I'm creating an internship recruitment roster, and I'm looking to program the sheet to do a few things automatically:

    1) Every intern is labeled with a status letter under a "Status" column, such as A for hire, for F for fail. I would like to program the sheet to automatically assign the row of a given letter the color I designate, and put a border around it. Unfortunately, there are more letters in use than conditional formatting can keep up with.

    2) Every time I enter a new person in the system (by typing in their status letter), I would like the sheet to automatically sort itself in a given range (all cells except my headers, which range in row from 1:A-1:N

    Thank you!

  2. #2
    Forum Expert
    Join Date
    01-03-2006
    Location
    Waikato, New Zealand
    MS-Off Ver
    2010 @ work & 2007 @ home
    Posts
    2,243

    Re: VBA Row Programming

    hi aegliveinterns,

    Welcome to the Forum

    Can you please upload a sample file?
    Are you familar with macros?
    If so, can you please record a macro of your actions (relating to each question) & include this in the sample file to give us a starting point.

    1) Please include an extra sheet that has the list of your Status Letters with each cell being coloured as you would like the finished product coloured.

    2) This will be much clearer with your file & recorded code. However, to clarify, do you want the information sorted vertically or horizontally?
    Can you please include an example "before & after" in the sample file?

    Thanks
    Rob
    Rob Brockett
    Kiwi in the UK
    Always learning & the best way to learn is to experience...

  3. #3
    Registered User
    Join Date
    04-28-2010
    Location
    Los Angeles, CA
    MS-Off Ver
    Excel 2003
    Posts
    28

    Re: VBA Row Programming

    Hi Rob!

    Thanks so much for getting back to me, this is a really important project for work and I really appreciate the help. I included a screenshot of the worksheet I'm using.

    A - bright green
    B - light green
    C - light orange
    E - yellow
    F - red

    I hope to sort vertically by status column, and then by name column. If possible, I'd also like to program the page to border new entries when I assign a letter to a name. And auto-sort would be awesome. Thank you so much!

    Nate
    Attached Files Attached Files

  4. #4
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2010, 2019
    Posts
    40,689

    Re: VBA Row Programming

    How can anyone test a macro on your PDF?
    Entia non sunt multiplicanda sine necessitate

  5. #5
    Registered User
    Join Date
    04-28-2010
    Location
    Los Angeles, CA
    MS-Off Ver
    Excel 2003
    Posts
    28

    Re: VBA Row Programming

    Sorry about that, here's the actual excel
    Attached Files Attached Files

  6. #6
    Registered User
    Join Date
    04-28-2010
    Location
    Los Angeles, CA
    MS-Off Ver
    Excel 2003
    Posts
    28

    Re: VBA Row Programming

    Any luck with the programming?

  7. #7
    Forum Expert
    Join Date
    01-03-2006
    Location
    Waikato, New Zealand
    MS-Off Ver
    2010 @ work & 2007 @ home
    Posts
    2,243

    Re: VBA Row Programming

    hi,

    You were sooo close
    I think the attached file does everything you want. I made some minor changes, then moved your macro into a normal module, renamed it, and then created one line worksheet change macros in each sheet module to call your original macro. I've made the assumption that each sheet will have the same layout and have tried to make the code easier to adapt by making more variables or constants. This means that the code only needs to be changed in one place.


    hth
    Rob
    Attached Files Attached Files

  8. #8
    Registered User
    Join Date
    04-28-2010
    Location
    Los Angeles, CA
    MS-Off Ver
    Excel 2003
    Posts
    28

    Re: VBA Row Programming

    Hi Rob,

    Thanks for all the work you did on my worksheet! However, it didn't work when I put in a letter in the Status column. I've attached a picture of the problem. It tells me there's a compile argument, and then brings me back to the VBA screen. Please let me know what I can do on my end to fix this problem. Thanks so much!

    Nate
    Attached Images Attached Images

  9. #9
    Forum Expert
    Join Date
    01-03-2006
    Location
    Waikato, New Zealand
    MS-Off Ver
    2010 @ work & 2007 @ home
    Posts
    2,243

    Re: VBA Row Programming

    Hi Nate,

    Sorry, I've only just seen your post. The file works for me - let's see if we can narrow it down...?

    - What is the exact wording of the error message?
    - If you go to the VBE & press [alt + D + L], what line gets highlighted?
    - Also in the VBE, press [alt + T + R], do any of the ticked "Available References" state "missing"?
    - Is one of the ticked References called "Microsoft Excel ##.# Object Library"?
    (where ##.# is "10.0" or "11.0")
    If not, scroll down the list, find it & tick it.

    hth
    Rob

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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