Assigning empty Cell in VBA If - Clause

xRusty04x

New Member
Joined
Feb 9, 2016
Messages
2
Dear All,

I am struggeling with an issue and can't find any useful information on google.

I want to perform a formula, defined in VBA, that should assign "" to a cell, in case the operation is false.

So far that's the best approach I could reach:

emptyValue is a variable to which I assigned vbNullString. This gives me 0 in the excel woorkbook. However every time I tried to assign "" to the If Clause I got an error. I tried many different notations, but couldn't find the right solution. Does someone of you guys can help me out?

strFormulas(2) = "=if(countblank(H3)=0,concatenate(A3,H3)," & emptyValue & ")"

Thank you very much in advance and best regards,

Brian
 

Some videos you may like

Excel Facts

Repeat Last Command
Pressing F4 adds dollar signs when editing a formula. When not editing, F4 repeats last command.

RickXL

MrExcel MVP
Joined
Sep 9, 2013
Messages
4,314
Hi and welcome to the MrExcel Message Board.

Try this:
Code:
strFormulas(2) = "=if(countblank(H3)=0,concatenate(A3,H3),"""")"
 

xRusty04x

New Member
Joined
Feb 9, 2016
Messages
2
Hi and welcome to the MrExcel Message Board.

Try this:
Code:
strFormulas(2) = "=if(countblank(H3)=0,concatenate(A3,H3),"""")"
Of course, why not go for the simplest solution :LOL::LOL::LOL: Thank you very much, it worked perfectly. Thx for the great support and fast answer!
 

Watch MrExcel Video

Forum statistics

Threads
1,099,505
Messages
5,469,017
Members
406,628
Latest member
jared92

This Week's Hot Topics

Top