+ Reply to Thread
Results 1 to 5 of 5

Macro to clear column based on header title

  1. #1
    Forum Contributor
    Join Date
    12-18-2011
    Location
    long island
    MS-Off Ver
    365
    Posts
    236

    Macro to clear column based on header title

    Hello,

    I have a worksheet with headers in Row 3. My sheet is structured in repeating segments. What I need to do is find any header in row 3 with the title "New" and clear that column from rows 4 to 400.

    I'm sure this is possible, but I can't seem to get the coding right.

  2. #2
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,167

    Re: Macro to clear column based on header title

    Hi phbryan,

    See if this code makes sense to you.
    Please Login or Register  to view this content.
    Instead of
    Please Login or Register  to view this content.
    I like to use sometimes.
    Please Login or Register  to view this content.
    I've shown both types in my code above.
    Last edited by MarvinP; 12-06-2022 at 11:47 AM.
    One test is worth a thousand opinions.
    Click the * Add Reputation below to say thanks.

  3. #3
    Forum Contributor
    Join Date
    12-18-2011
    Location
    long island
    MS-Off Ver
    365
    Posts
    236

    Re: Macro to clear column based on header title

    Hi MarvinP,

    Both versions of this code work, but only for the first occurrence of "New" in row 3. I need the code to continue and find the next occurrence of "New".
    I have "New" in J3, O3, T3, etc.

  4. #4
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,167

    Re: Macro to clear column based on header title

    Hi phbryan,

    Small change to clear All those New columns looks like this:
    Please Login or Register  to view this content.

  5. #5
    Forum Contributor
    Join Date
    12-18-2011
    Location
    long island
    MS-Off Ver
    365
    Posts
    236

    Re: Macro to clear column based on header title

    That worked!

    Thank you!

+ 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. [SOLVED] Clear all cells in column based off column header
    By phbryan in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 11-21-2022, 01:32 PM
  2. Removing mulitple columns based on header title
    By glatchman in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 08-25-2022, 04:26 AM
  3. Referencing a Column Header that contains '#' in its title
    By Larry Stevens in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-23-2020, 08:42 PM
  4. macro to lock cell by column header based on value in another cell by column header
    By Closet Guru in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 04-03-2015, 12:36 PM
  5. [SOLVED] Clear all data below header row in specific column
    By ks100 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 01-02-2014, 04:50 PM
  6. How do you clear the label in a column header?
    By susiesc in forum Excel General
    Replies: 8
    Last Post: 03-31-2013, 01:35 PM
  7. Column Header to = Saved File's Title
    By wmfinance in forum Excel General
    Replies: 4
    Last Post: 08-13-2010, 02:30 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