Results 1 to 9 of 9

Thread: VB code to Run formula untill blank cell

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Forum Guru Rick Rothstein's Avatar
    Join Date
    Feb 2012
    Posts
    662
    Rep Power
    14
    I am not sure how your subject title relates to your actual request (your request deals with formulas, not VB code), but see if this answers your question...

    It doesn't matter whether you drag down or to the right, the standard way to stop outputting visible results is to test the critical formula's cell for being empty and then output the empty string if it is. For example, let's say your formula in A2 was this...

    ="Value: "&A1

    Obviously, as you drag it across, you will output just "Value: " when you run out of data in Row 1. If you modify the formula to this (testing the critical cell for being empty), you will only output something if there is a value in the corresponding Row 1 cell...

    =IF(A1="","","Value: "&A1)

    The general principle is this... see if a cell is blank and, if it is, output the empty string instead of the calculation.
    Last edited by Rick Rothstein; 05-16-2012 at 12:04 AM.

Similar Threads

  1. Replies: 13
    Last Post: 06-10-2013, 09:05 AM
  2. Removing unused Cell styles - need an efficient code
    By siddharthsindhwani in forum Excel Help
    Replies: 8
    Last Post: 04-15-2013, 07:12 AM
  3. Autofill the data based on non blank cell in next row?
    By Rajesh Kr Joshi in forum Excel Help
    Replies: 3
    Last Post: 11-29-2012, 04:16 PM
  4. Replies: 2
    Last Post: 09-24-2012, 11:19 PM
  5. Replies: 1
    Last Post: 04-24-2012, 09:55 PM

Posting Permissions

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