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
 

Excel Facts

Formula for Yesterday
Name Manager, New Name. Yesterday =TODAY()-1. OK. Then, use =YESTERDAY in any cell. Tomorrow could be =TODAY()+1.
Hi and welcome to the MrExcel Message Board.

Try this:
Code:
strFormulas(2) = "=if(countblank(H3)=0,concatenate(A3,H3),"""")"
 
Upvote 0
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!
 
Upvote 0

Forum statistics

Threads
1,214,998
Messages
6,122,643
Members
449,093
Latest member
Ahmad123098

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top