Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,441
Default 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



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Inputting Dates Formula? Scott Excel Discussion (Misc queries) 5 March 22nd 10 07:23 PM
Cell not available when inputting formula Lyn Excel Worksheet Functions 2 April 14th 09 06:38 PM
Inputting SAME formula within EVERY (ALL) Worksheet FLKULCHAR Excel Worksheet Functions 1 September 30th 05 07:13 PM
inputting text on Word document using excel [email protected] Excel Programming 1 June 6th 05 02:14 PM
Inputting numbers only in Text Box Anthony Slater Excel Programming 5 October 15th 04 08:15 PM


All times are GMT +1. The time now is 06:45 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"