+ Reply to Thread
Results 1 to 4 of 4

If cell is not empty - insert formula to another cell

  1. #1
    Registered User
    Join Date
    02-27-2018
    Location
    Poland
    MS-Off Ver
    Office 2013
    Posts
    3

    If cell is not empty - insert formula to another cell

    Guys,

    I've got an excel sheet with a dropdown list (list of companies).

    If I choose an item from drop down list, a macro is executed. The macro inserts vlookup formula to the range of cells (Range is D7:D300).

    What I would like to achieve, is to not to run the macro if there is nothing in the cells from B7:B300 (nothing to vlookup for).

    My current code looks like this:

    Please Login or Register  to view this content.
    And the macros:

    Please Login or Register  to view this content.
    Currently, if I input 10 values to look for in another sheet, and I run the macro (select company from drop down list), it provides me with the result for the 10 values and inputs an error to the rest 290 cells. I would like to avoid that.

    Cheers
    Deric

  2. #2
    Forum Expert mikerickson's Avatar
    Join Date
    03-30-2007
    Location
    Davis CA
    MS-Off Ver
    Excel 2011
    Posts
    6,229

    Re: If cell is not empty - insert formula to another cell

    Please Login or Register  to view this content.
    Last edited by mikerickson; 02-27-2018 at 10:12 AM.
    _
    ...How to Cross-post politely...
    ..Wrap code by selecting the code and clicking the # or read this. Thank you.

  3. #3
    Forum Expert
    Join Date
    11-22-2016
    Location
    Cornwall,UK
    MS-Off Ver
    office 365
    Posts
    4,240

    Re: If cell is not empty - insert formula to another cell

    What I would like to achieve, is to not to run the macro if there is nothing in the cells from B7:B300
    One way
    Please Login or Register  to view this content.
    Last edited by kev_; 02-27-2018 at 10:13 AM.
    Click *Add Reputation to thank those who helped you. Ask if anything is not clear

  4. #4
    Registered User
    Join Date
    02-27-2018
    Location
    Poland
    MS-Off Ver
    Office 2013
    Posts
    3

    Re: If cell is not empty - insert formula to another cell

    Thank you guys for your answers. I have also found another solution that works:

    Please Login or Register  to view this content.

+ 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] Insert vlookup formula into next empty cell in column B
    By JamesT1 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-12-2016, 05:55 AM
  2. Insert Table on first empty cell in row
    By james_xs in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 03-02-2016, 10:19 AM
  3. [SOLVED] Paste formula to the last empty cell based on a non-empty cell on another column
    By bhenlee in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 04-02-2015, 04:07 PM
  4. How to insert an empty cell down the column?
    By gabrielemucho in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 10-25-2013, 10:53 AM
  5. How to find empty cell and insert vlookup formula
    By sathu in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-14-2013, 10:02 AM
  6. [SOLVED] Find empty cells in a range and insert formula in adjacent cell
    By macronovice1 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 10-25-2012, 03:06 PM
  7. [SOLVED] Insert and sum in empty cell
    By salsal in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 07-05-2006, 11:20 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