Use of Double quotes in VBA IF Statement

  • Thread starter Thread starter steveski
  • Start date Start date
S

steveski

I want to test a field to see if it is empty. In a spreaadsheet, I can
use double quotes, but in VBA it doesn't work. Can you help?

Target(1, 5).FormulaR1C1 = "=IF(RC9="","","Not Empty")"
 
And from a tip by Tom Ogilvy:

Dim myStr As String
myStr = "=IF(RC9=@@,@@,@Not Empty@)"
myStr = Application.Substitute(myStr, "@", Chr(34))
ActiveCell.FormulaR1C1 = myStr
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top