Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 586
Default Need to you quotations ("") in a string.

I have a formula that requires quotations around the X in the formula but VBA
will not allow me to do it. Is there a way around this because I have to
have the quotations around the X in the formula bar for the formula to work.

Sub InsertFormula()

Const Depts As String = "Engineering"

With Sheets("Summary")
.Range("D34").Formula = "=SUMPRODUCT(--(" & Depts &
"Dates<=$J$4),--(" & Depts & "Indicators="X")," & Depts & "Hours)*(1+$J$10)"

End With
End Sub
--
Cheers,
Ryan
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,939
Default Need to you quotations ("") in a string.

Double up the quotes...

With Sheets("Summary")
.Range("D34").Formula = "=SUMPRODUCT(--(" & Depts &
"Dates<=$J$4),--(" & Depts & "Indicators=""X"")," & Depts & "Hours)*(1+$J$10)"

End With

--
HTH...

Jim Thomlinson


"RyanH" wrote:

I have a formula that requires quotations around the X in the formula but VBA
will not allow me to do it. Is there a way around this because I have to
have the quotations around the X in the formula bar for the formula to work.

Sub InsertFormula()

Const Depts As String = "Engineering"

With Sheets("Summary")
.Range("D34").Formula = "=SUMPRODUCT(--(" & Depts &
"Dates<=$J$4),--(" & Depts & "Indicators="X")," & Depts & "Hours)*(1+$J$10)"

End With
End Sub
--
Cheers,
Ryan

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
=SUBSTITUTE(C4,"~?#","") will this work to remove multiple string Raja Mahendiran S Excel Worksheet Functions 6 May 12th 10 09:10 PM
Converting "uppercase" string data to "lower case" in CSV file [email protected] Excel Discussion (Misc queries) 2 August 12th 08 08:36 PM
text string: "91E10" in csv file auto converts to: "9.10E+11" [email protected] Excel Discussion (Misc queries) 2 August 12th 08 03:13 PM
Converting string "061123" into a date "23/11/06" WhytheQ Excel Programming 3 November 24th 06 11:41 AM
Making "examp le" become "examp_le" in a string Sworkhard Excel Programming 3 October 29th 04 09:31 PM


All times are GMT +1. The time now is 02:17 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"