ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Inputting text in a formula (https://www.excelbanter.com/excel-programming/338178-inputting-text-formula.html)

PGalla06[_10_]

Inputting text in a formula
 

I'm trying to write an if statement using VBA that returns text, howeve
I can't seem to figure out how to get it to work as I need to includ
apostrophes in the if statement. Below is the code that I'm workin
with:

Range("V2").Formula = "=IF(" & "Q2" & "0," & "Indemnity" & ","
"Medical" & ")"

Any help would be greatly appreciated.

Thanks,
Pete

--
PGalla0
-----------------------------------------------------------------------
PGalla06's Profile: http://www.excelforum.com/member.php...fo&userid=2426
View this thread: http://www.excelforum.com/showthread.php?threadid=39860


Bernie Deitrick

Inputting text in a formula
 
Peter,

Range("V2").Formula = "=IF(Q20,""Indemnity"",""Medical"")"

HTH,
Bernie
MS Excel MVP


"PGalla06" wrote in message
...

I'm trying to write an if statement using VBA that returns text, however
I can't seem to figure out how to get it to work as I need to include
apostrophes in the if statement. Below is the code that I'm working
with:

Range("V2").Formula = "=IF(" & "Q2" & "0," & "Indemnity" & "," &
"Medical" & ")"

Any help would be greatly appreciated.

Thanks,
Peter


--
PGalla06
------------------------------------------------------------------------
PGalla06's Profile: http://www.excelforum.com/member.php...o&userid=24260
View this thread: http://www.excelforum.com/showthread...hreadid=398605





All times are GMT +1. The time now is 04:20 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com