Consulting

Results 1 to 6 of 6

Thread: Solved: Clearing Column Contents

  1. #1
    VBAX Mentor
    Joined
    Jan 2006
    Posts
    323
    Location

    Solved: Clearing Column Contents

    Im trying to write some code to clear the contents and borders of columns A thru g with the exception of the first two rows which I want to remain. I think it is a simple one but I can't figure it out.

    Thanks In Advance
    Gary

  2. #2
    Site Admin
    Jedi Master
    VBAX Guru Jacob Hilderbrand's Avatar
    Joined
    Jun 2004
    Location
    Roseville, CA
    Posts
    3,712
    Location
    Try this:

    [vba]
    With Range("A3:G65536")
    .ClearContents
    .Borders.LineStyle = xlNone
    End With
    [/vba]

  3. #3
    VBAX Mentor
    Joined
    Jan 2006
    Posts
    323
    Location
    Thanks DRJ, I thought there would have been an easier way using entirecolumn or something like that.
    Thanks Again

  4. #4
    VBAX Master XLGibbs's Avatar
    Joined
    Jan 2006
    Location
    state of confusion, but vacation in denial
    Posts
    1,315
    Location
    Yes, but entirecolumn would not allow retaining the status quo in rows 1 and 2 as you wished.
    If you have posted the same question at multiple forums, please read this IMPORTANT INFO.

    Please use the thread tools to mark your thread Solved


    Please review the Knowledge Base
    for samples and solutions , or to submit your own!




  5. #5
    VBAX Mentor
    Joined
    Jan 2006
    Posts
    323
    Location
    Ok, I thought maybe an exception for the two rows could be made. Thanks guys problem solved. I would mark this thread as solved but I can't find that tool anymore.

  6. #6
    VBAX Master XLGibbs's Avatar
    Joined
    Jan 2006
    Location
    state of confusion, but vacation in denial
    Posts
    1,315
    Location
    Once the board upgrades are resolved, we will mark it solved for you...the feature is temporarily unavailable.
    If you have posted the same question at multiple forums, please read this IMPORTANT INFO.

    Please use the thread tools to mark your thread Solved


    Please review the Knowledge Base
    for samples and solutions , or to submit your own!




Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •