+ Reply to Thread
Results 1 to 5 of 5

Changing column values based on header values

  1. #1
    Registered User
    Join Date
    12-23-2012
    Location
    Glasgow, Scotland
    MS-Off Ver
    Office 365 for Mac
    Posts
    23

    Changing column values based on header values

    Well hello all!

    I'm a newbie here so apologies if my question seems a little basic or my explanation long winded ....

    I have an excel sheet I use to capture the availability of individuals to work on given days, each month I change the date in cell A1 and this generates a calendar for the month

    I'm trying to write some VBA code to reset the sheet each month but I want it to set columns for Sat/Sun to X, I'm not having much luck!

    So my days are in range Row 2, my names are in A3:A12. So if E2 = Sat, range E3:E12 will be set to X, F2 will be Sun so F3:F12 will be set to X looping through the 31 columns ....

    Any help you can offer would be greatly appreciated, thank you!

  2. #2
    Forum Expert JasperD's Avatar
    Join Date
    05-07-2013
    Location
    Netherlands
    MS-Off Ver
    Excel 2016
    Posts
    1,393

    Re: Changing column values based on header values

    Try this

    Please Login or Register  to view this content.
    Please click the * below if this helps

  3. #3
    Registered User
    Join Date
    12-23-2012
    Location
    Glasgow, Scotland
    MS-Off Ver
    Office 365 for Mac
    Posts
    23

    Re: Changing column values based on header values

    Hi JasperD and many thanks for your response.

    I have tried your code and unfortunately, whilst I don't get an error message for debugging, I don't get any X's either.

    My VBA knowledge is quite basic compared to many here I guess and I really cannot get my head around this one, yet it looks like it should be quite simple to solve.

    Thank you again for taking the time to respond!

  4. #4
    Forum Expert JasperD's Avatar
    Join Date
    05-07-2013
    Location
    Netherlands
    MS-Off Ver
    Excel 2016
    Posts
    1,393

    Re: Changing column values based on header values

    Sorry, I didn't read your original post properly and didn't see your days are in row 2. The code checked row 1.
    Code adjusted as below.

    Please Login or Register  to view this content.
    Please click the * below if this helps

  5. #5
    Registered User
    Join Date
    12-23-2012
    Location
    Glasgow, Scotland
    MS-Off Ver
    Office 365 for Mac
    Posts
    23

    Re: Changing column values based on header values

    Perfect, thank you so much, just what I wanted and I can now also relate the code to how it works .... time to do some more reading up!

    I can now expand on this to do some other things I need to automate to save me time on a daily basis.

    Thank you again!

+ 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