+ Reply to Thread
Results 1 to 2 of 2

Replace empty cells in range variable

  1. #1
    Registered User
    Join Date
    07-14-2006
    Location
    Netherlands
    MS-Off Ver
    2000, 2003, and 2007
    Posts
    32

    Replace empty cells in range variable

    I'm creating a custom function in which I also do a sumproduct so I transfer 2 ranges to the VBA code.

    Sometimes the first column contains rows which don't have a value yet and then that empty cell (0 in the range, I believe) should be replaced with a default aaa value.

    How can I replace the empty cells in the first range with the default value in the range within the macro?

    I've tried below code setup but that doesn't work... and I seem to be unable to find any proper example on replacing values in a range in a VBA function

    Please Login or Register  to view this content.
    example.png
    Life's a canvas, you fill the picture!

  2. #2
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: Replace empty cells in range variable

    Any chance you could upload a sample workbook?

    Click on GO ADVANCED and use the paperclip icon to open the upload window.
    If posting code please use code tags, see here.

+ 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] If cell is empty in a variable range, stop macro and return error message
    By Andrei Kononenko in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 03-22-2019, 02:19 PM
  2. MACRO to empty a range of cells based on whether specified cell is empty
    By TBJV in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 05-01-2013, 10:35 PM
  3. Multiple Find/Replace within Variable Range
    By freybe06 in forum Excel Programming / VBA / Macros
    Replies: 13
    Last Post: 04-30-2013, 06:24 PM
  4. [SOLVED] Replace empty cells with zero in a range
    By Snoopy2003 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 11-23-2012, 06:35 PM
  5. Copy variable range to database next empty row
    By sammar12 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-29-2009, 11:09 AM
  6. Replace empty cells with blank space
    By charles.2345 in forum Excel General
    Replies: 10
    Last Post: 08-02-2008, 08:31 PM
  7. [SOLVED] If Range Variable isn't Empty
    By achidsey in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 10-19-2005, 03:05 PM
  8. [SOLVED] empty variable range
    By S1 in forum Excel General
    Replies: 6
    Last Post: 01-28-2005, 02:06 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