+ Reply to Thread
Results 1 to 6 of 6

Copy Value of another Cell if Blank

  1. #1
    Forum Contributor
    Join Date
    11-02-2010
    Location
    Philippines
    MS-Off Ver
    Excel 2003
    Posts
    353

    Copy Value of another Cell if Blank

    Hi all,
    Can you help me with a Macro again please?
    What I wanted to do is to check for blanks in Column B, if its blank, it should copy the value shown in Column A.
    In my attached example, cell B4 is blank, it should copy cell A4; cell B8 and B9 are blank, it should copy the values of A8 and A9.

    Column A is always populated with value hence there is always something to copy.
    Also, my rows can change from 10 to 500000.

    Appreciate any help. I have attached my dummy spreadsheet.
    Thanks in advance.

    Regards,
    Andrew
    Attached Files Attached Files
    Last edited by Andrew.Trevayne; 12-16-2019 at 03:02 AM.

  2. #2
    Forum Guru bakerman2's Avatar
    Join Date
    10-03-2012
    Location
    Antwerp, Belgium
    MS-Off Ver
    MO Prof Plus 2016
    Posts
    6,907

    Re: Copy Value of another Cell if Blank

    For starters.

    Please Login or Register  to view this content.
    Avoid using Select, Selection and Activate in your code. Use With ... End With instead.
    You can show your appreciation for those that have helped you by clicking the * at the bottom left of any of their posts.

  3. #3
    Forum Expert Alf's Avatar
    Join Date
    03-13-2004
    Location
    Gothenburg/Mullsjoe, Sweden
    MS-Off Ver
    Excel 2019 and not sure I like it
    Posts
    4,758

    Re: Copy Value of another Cell if Blank

    As your number of rows may go up to 500000 perhaps autofilter is a faster option?

    Please Login or Register  to view this content.
    Alf

  4. #4
    Forum Contributor
    Join Date
    11-02-2010
    Location
    Philippines
    MS-Off Ver
    Excel 2003
    Posts
    353

    Re: Copy Value of another Cell if Blank

    Thank you both. Appreciate you taking time.
    Cheers.

    Andrew

  5. #5
    Forum Guru bakerman2's Avatar
    Join Date
    10-03-2012
    Location
    Antwerp, Belgium
    MS-Off Ver
    MO Prof Plus 2016
    Posts
    6,907

    Re: Copy Value of another Cell if Blank

    Glad to help and thanks for rep+.

  6. #6
    Forum Expert Alf's Avatar
    Join Date
    03-13-2004
    Location
    Gothenburg/Mullsjoe, Sweden
    MS-Off Ver
    Excel 2019 and not sure I like it
    Posts
    4,758

    Re: Copy Value of another Cell if Blank

    I second that

    Alf

+ 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. Replies: 4
    Last Post: 07-30-2019, 11:03 AM
  2. [SOLVED] copy value up to last blank cell with a succeeding non blank cell
    By k1dr0ck in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 12-18-2017, 07:35 AM
  3. vba to copy and insert row and copy/paste cell value if cell not blank!
    By GaryDML in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-27-2014, 02:17 AM
  4. [SOLVED] VBA to find blank cell then copy data next to blank cell
    By unreal_event_horizon in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 12-21-2012, 05:46 AM
  5. Replies: 1
    Last Post: 11-08-2012, 05:50 PM
  6. [SOLVED] Find first non-blank cell after a group of blanks copy offset cells, find next blank, loop
    By gwsampso in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 10-21-2012, 06:11 AM
  7. Replies: 1
    Last Post: 01-15-2005, 06:06 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