ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Having problems with quotation marks (https://www.excelbanter.com/excel-programming/363957-having-problems-quotation-marks.html)

headly

Having problems with quotation marks
 
This formula doesn't work; I tried ampersands but no luck, any ideas
appreciated. TY

if range("D2").Formula = "=IF(C240,"Overtime","Normal") then ok = ok + 1

Paul Mathews

Having problems with quotation marks
 
if range("D2").Formula = "=IF(C240,""Overtime"",""Normal"")" then...

"headly" wrote:

This formula doesn't work; I tried ampersands but no luck, any ideas
appreciated. TY

if range("D2").Formula = "=IF(C240,"Overtime","Normal") then ok = ok + 1


ward376

Having problems with quotation marks
 
This will check to see if the formula matches. I'm not sure what you're
trying to do.


Sub checkFormula()
If ThisWorkbook.Sheets("sheet1").Range("D2").Formula = _
"=IF(C240,""Overtime"",""Normal"")" Then
MsgBox "I don't know what you're doing here." & vbNewLine &
vbNewLine & _
"ok = ok + 1"
Else
MsgBox "Formula doesn't fit description"
End If
End Sub



All times are GMT +1. The time now is 09:38 PM.

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