+ Reply to Thread
Results 1 to 12 of 12

Clear Contents of Repeating Column Ranges

  1. #1
    Banned User!
    Join Date
    09-26-2017
    Location
    USA
    MS-Off Ver
    2010
    Posts
    607

    Clear Contents of Repeating Column Ranges

    Hello I have a sheet with experimental data that I want to be able to clear so I can retest the formulas and codes.

    The ranges are :

    C5:F400
    H5:K400
    M5:P400

    and across to including all groups

    DS5:DV400

    These skip a column and I was wondering if there can be a code that I can select to run to clear these cells of content.

    I appreciate any help or suggestions,
    Billy

  2. #2
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    12,720

    Re: Clear Contents of Repeating Column Ranges

    How about
    Please Login or Register  to view this content.

  3. #3
    Banned User!
    Join Date
    09-26-2017
    Location
    USA
    MS-Off Ver
    2010
    Posts
    607

    Re: Clear Contents of Repeating Column Ranges

    That works great thanks. One other question if possible. I assigned it to a shape to click and run it. Can I have it password protected?

  4. #4
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    12,720

    Re: Clear Contents of Repeating Column Ranges

    If you mean stop other people from using the macro, try
    Please Login or Register  to view this content.
    Where the value in red is the password

  5. #5
    Banned User!
    Join Date
    09-26-2017
    Location
    USA
    MS-Off Ver
    2010
    Posts
    607

    Re: Clear Contents of Repeating Column Ranges

    great that is perfect!

  6. #6
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    12,720

    Re: Clear Contents of Repeating Column Ranges

    Glad to help & thanks for the feedback

  7. #7
    Banned User!
    Join Date
    09-26-2017
    Location
    USA
    MS-Off Ver
    2010
    Posts
    607

    Re: Clear Contents of Repeating Column Ranges

    Hello again,

    I know this one is solved but I have another sheet to clear.

    The ranges are different though.

    G5:I400
    P5:R400

    HO5:HQ400

    Can this be done also with a similar password protected code?

    Thank you,
    Billy

  8. #8
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    12,720

    Re: Clear Contents of Repeating Column Ranges

    Copy the nacro & change the last part to
    Please Login or Register  to view this content.

  9. #9
    Banned User!
    Join Date
    09-26-2017
    Location
    USA
    MS-Off Ver
    2010
    Posts
    607

    Re: Clear Contents of Repeating Column Ranges

    Brilliant!

    I am trying to figure out the numbers. Can you explain how it works?

  10. #10
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    12,720

    Re: Clear Contents of Repeating Column Ranges

    It's basically working on columns, so
    7 is col G
    225 is col HQ
    Step 9 means i goes from 7 to 16 to 25 etc which is then Cols G,P,Y etc
    so we start with cells(5,i) which is G5, then resize(396,3) means to resize by 396 rows making G5:G400 & by 3 columns making it G5:I400
    i then becomes 16 so we have P5 which is resized to P5:R400

    HTH

  11. #11
    Banned User!
    Join Date
    09-26-2017
    Location
    USA
    MS-Off Ver
    2010
    Posts
    607

    Re: Clear Contents of Repeating Column Ranges

    That does help thank you very much. This is quite handy and I will put it to good use.


  12. #12
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    12,720

    Re: Clear Contents of Repeating Column Ranges

    Glad to help

+ 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 contents of column(L) after every one row
    By HaroonSid in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 03-02-2017, 06:00 AM
  2. Loop to clear cell contents by column (but not entire column)
    By codys21 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-11-2016, 03:26 PM
  3. [SOLVED] Clear contents for a few non-adjacent ranges
    By billj in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-26-2016, 06:17 AM
  4. I need to code to clear contents the several fixed ranges of several sheets
    By samahhamaad in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 05-03-2016, 05:21 PM
  5. [SOLVED] vba to clear contents in specific ranges on active sheet
    By blackburnsexcel in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 12-01-2014, 09:35 AM
  6. Clear Contents on Column
    By martinez_pedro in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 01-14-2012, 06:40 AM
  7. macro to clear contents of two ranges if cell is blank
    By fisher-price in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-30-2011, 10:39 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