+ Reply to Thread
Results 1 to 7 of 7

Copy & Clear (auto)

  1. #1
    Forum Contributor
    Join Date
    01-26-2018
    Location
    London, England
    MS-Off Ver
    365
    Posts
    311

    Copy & Clear (auto)

    Been working on a basic macro to copy & clear out the "false blanks" from my data

    Please Login or Register  to view this content.
    However I just wondered how I could adjust the macro to:

    1. Perform the code automatically if either KY1 or KZ1 gets changed
    2. Only initially copy down to the cells which have values (KY2:KZ15) (i.e. dynamic & not set to 2000)

    Cheers
    Mdn
    Attached Files Attached Files

  2. #2
    Forum Expert Mumps1's Avatar
    Join Date
    10-10-2012
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2010, 2013
    Posts
    7,821

    Re: Copy & Clear (auto)

    Place this macro in the worksheet code module. Change a value in KY1 or KZ1 and exit the cell.
    Please Login or Register  to view this content.
    I couldn't understand the purpose of the part of your code that clears the contents. If a cell is already blank, there is no need to "ClearContents".
    You can say "THANK YOU" for help received by clicking the Star symbol at the bottom left of the helper's post.
    Practice makes perfect. I'm very far from perfect so I'm still practising.

  3. #3
    Forum Contributor
    Join Date
    01-26-2018
    Location
    London, England
    MS-Off Ver
    365
    Posts
    311

    Re: Copy & Clear (auto)

    Quote Originally Posted by Mumps1 View Post
    Place this macro in the worksheet code module. Change a value in KY1 or KZ1 and exit the cell.
    I couldn't understand the purpose of the part of your code that clears the contents. If a cell is already blank, there is no need to "ClearContents".
    The problem is it's not blank (I wish it was blank!!)

    s2NpLCmgQ6eKRsZA6zbV2g.png

    Column LE is looking at column LC, the blanks should be true (ISBLANK), but aren't.

    The problem above is linked to an early thread (https://www.excelforum.com/excel-for...e-matches.html) & Special-K's formula only works if the cells are really blank

  4. #4
    Forum Expert Mumps1's Avatar
    Join Date
    10-10-2012
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2010, 2013
    Posts
    7,821

    Re: Copy & Clear (auto)

    If column LC isn't blank, what's in it? As far as I could determine, the cells in column LC that appear blank, are blank. If I use a formula such as =LEN(LC2), it returns a length of zero meaning there is nothing in cell LC2. Did the macro I suggested work for you in copying the values of KY2:KZ15?

  5. #5
    Forum Contributor
    Join Date
    01-26-2018
    Location
    London, England
    MS-Off Ver
    365
    Posts
    311

    Re: Copy & Clear (auto)

    If that's the case why is =ISBLANK(LC2) returning false?

    W6P8DDxkSDyfzUt9LhGoCQ.png

    The copy bit works great, however the purpose of the macro was to also remove the blanks (i.e. ClearContents) (i.e. atm it only does half the job)

  6. #6
    Forum Contributor
    Join Date
    01-26-2018
    Location
    London, England
    MS-Off Ver
    365
    Posts
    311

    Re: Copy & Clear (auto)

    Here's what I need it to look like (hence why the ClearContents bit is an unsung hero!)

    4r0LNqIXRGW-9nwPlMcksA.png

  7. #7
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,080

    Re: Copy & Clear (auto)

    This will make the blanks blank
    Please Login or Register  to view this content.
    Change the columns to suit.
    Based on this thread you started https://www.excelforum.com/excel-pro...ml#post4899819

+ 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. auto clear subroutine not working
    By sghstaples in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-14-2017, 11:40 AM
  2. auto macro to clear contents
    By thuddleston11 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 03-22-2012, 11:31 AM
  3. Auto clear contents
    By stevei in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 12-07-2010, 01:21 PM
  4. Auto Clear
    By Sharp in forum Excel General
    Replies: 1
    Last Post: 12-12-2006, 08:38 AM
  5. [SOLVED] Clear cells in Column D if not = Auto
    By JOUIOUI in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 06-11-2006, 08:40 AM
  6. Auto Open - Clear all filters
    By klm in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 12-14-2005, 05:10 PM
  7. Auto clear when qualification is met
    By Paul987 in forum Excel General
    Replies: 1
    Last Post: 10-10-2005, 08:53 AM

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