+ Reply to Thread
Results 1 to 9 of 9

Using the Isblank function for the same cell (Isempty via VBA)

  1. #1
    Registered User
    Join Date
    04-22-2020
    Location
    Israel
    MS-Off Ver
    18.2992.1101.0
    Posts
    6

    Question Using the Isblank function for the same cell (Isempty via VBA)

    Hi.
    I’m trying to do the following action:
    If cell(B2) Isblank -> fill “Text” in cell(B2)
    Otherwise -> Leave cell(B2) as is

    I know functions usually cannot apply input & output for the same cell, but must use a range.
    So i’m looking for a VBA code with the Isempty function to make me happy. Any ideas?
    Thank!

  2. #2
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,643

    Re: Using the Isblank function for the same cell (Isempty via VBA)

    Please Login or Register  to view this content.
    Surround your VBA code with CODE tags e.g.;
    [CODE]your VBA code here[/CODE]
    The # button in the forum editor will apply CODE tags around your selected text.

  3. #3
    Registered User
    Join Date
    04-22-2020
    Location
    Israel
    MS-Off Ver
    18.2992.1101.0
    Posts
    6

    Re: Using the Isblank function for the same cell (Isempty via VBA)

    Thanks for the fast reply!
    So as i'm new to VBA, now i'm facing new challenges:
    1. it needs to be a loop. I mean to for every cell in column B
    2. i'm not sure how to run/apply the code.

    Thanks!

  4. #4
    Forum Expert
    Join Date
    11-24-2013
    Location
    Paris, France
    MS-Off Ver
    Excel 2003 / 2010
    Posts
    9,831

    Arrow Re: Using the Isblank function for the same cell (Isempty via VBA)


    Hi !

    1. No need to loop in VBA just using the Excel basics …

    1&2 : attach at least a sample workbook with the same layout than the original …

  5. #5
    Registered User
    Join Date
    04-22-2020
    Location
    Israel
    MS-Off Ver
    18.2992.1101.0
    Posts
    6

    Re: Using the Isblank function for the same cell (Isempty via VBA)

    Hi!

    Not sure i understand #1, but here is clarification:

    I got a list of products and column J is Product Type which i cannot leave empty.
    So if a cell Jx (J3 for example) is empty, i’d like it to be filled with “Unknown”.
    If it isn’t empty, i like to keep it the way it is.

    I hope that was good as a sample

  6. #6
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Using the Isblank function for the same cell (Isempty via VBA)

    Here's a one-liner

    Please Login or Register  to view this content.
    If I've helped you, please consider adding to my reputation - just click on the liitle star at the left.

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~(Pride has no aftertaste.)

    You can't do one thing. XLAdept

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~aka Orrin

  7. #7
    Registered User
    Join Date
    04-22-2020
    Location
    Israel
    MS-Off Ver
    18.2992.1101.0
    Posts
    6

    Re: Using the Isblank function for the same cell (Isempty via VBA)

    Works! Thank you so much! You earned my star and a place in heaven <3

  8. #8
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Using the Isblank function for the same cell (Isempty via VBA)

    You're welcome and thanks for the rep!

    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED.

  9. #9
    Forum Guru
    Join Date
    04-23-2012
    Location
    New Jersey, USA
    MS-Off Ver
    Excel 365
    Posts
    2,408

    Re: Using the Isblank function for the same cell (Isempty via VBA)

    For those who might be interested, here is another one-liner that will also work...
    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. isempty function is not working to show value if cell is empty
    By Shamz41 in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 09-13-2019, 02:15 PM
  2. Trying to figure out IsEmpty function. Please help
    By samiv4444 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-06-2017, 10:38 AM
  3. Isempty with If function in VBA
    By theprincesunil in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 11-27-2016, 02:00 PM
  4. Replies: 2
    Last Post: 06-19-2013, 05:48 PM
  5. [SOLVED] Use ISBLANK Function with Named Range Instead of Cell Address
    By Toner in forum Excel - New Users/Basics
    Replies: 2
    Last Post: 05-11-2012, 02:33 PM
  6. Help with ISBLANK function referring to a cell with another ISBLANK formula
    By camdameron in forum Excel Formulas & Functions
    Replies: 10
    Last Post: 03-23-2011, 12:45 PM
  7. ISBLANK function and Cell range
    By AndyF19 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-19-2010, 09:33 AM

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