Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Oh Wise Ones,
I have a sheet that inserts a row and formats some cells including this line that works: Worksheets("Open Red Tags").Range("Q4").Formula = "=IF(J4=$K$1,H4,"""")" but when I tried to format R4 like below I get an error as soon as I enter it: Unexpected end of statement Worksheets("Open Red Tags").Range("R4").Formula = "=IF(F4="A",H4,"""")" Then I tried this that didn't work: Worksheets("Open Red Tags").Range("R4").Formula = "=IF(F4=A,H4,"""")" What am I doing wrong? They seem so similar. Mike |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
You doubled up those double quotes in the last portion of the formula:
Worksheets("Open Red Tags").Range("R4").Formula = "=IF(F4="A",H4,"""")" But don't forget to do the same with the double quotes around A. Worksheets("Open Red Tags").Range("R4").Formula = "=IF(F4=""A"",H4,"""")" Mike K wrote: Oh Wise Ones, I have a sheet that inserts a row and formats some cells including this line that works: Worksheets("Open Red Tags").Range("Q4").Formula = "=IF(J4=$K$1,H4,"""")" but when I tried to format R4 like below I get an error as soon as I enter it: Unexpected end of statement Worksheets("Open Red Tags").Range("R4").Formula = "=IF(F4="A",H4,"""")" Then I tried this that didn't work: Worksheets("Open Red Tags").Range("R4").Formula = "=IF(F4=A,H4,"""")" What am I doing wrong? They seem so similar. Mike -- Dave Peterson |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Thanks Dave.
"Dave Peterson" wrote: You doubled up those double quotes in the last portion of the formula: Worksheets("Open Red Tags").Range("R4").Formula = "=IF(F4="A",H4,"""")" But don't forget to do the same with the double quotes around A. Worksheets("Open Red Tags").Range("R4").Formula = "=IF(F4=""A"",H4,"""")" Mike K wrote: Oh Wise Ones, I have a sheet that inserts a row and formats some cells including this line that works: Worksheets("Open Red Tags").Range("Q4").Formula = "=IF(J4=$K$1,H4,"""")" but when I tried to format R4 like below I get an error as soon as I enter it: Unexpected end of statement Worksheets("Open Red Tags").Range("R4").Formula = "=IF(F4="A",H4,"""")" Then I tried this that didn't work: Worksheets("Open Red Tags").Range("R4").Formula = "=IF(F4=A,H4,"""")" What am I doing wrong? They seem so similar. Mike -- Dave Peterson |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
VBA code to erase an array element returning Error 2042 ??? | Excel Programming | |||
Code required for VLookup returning #NA | Excel Discussion (Misc queries) | |||
error in code to format only a few sheets in workbook | Excel Programming | |||
"File Format Not Valid" When Starting Excel. Error Code 0D3F6000 | Excel Discussion (Misc queries) | |||
UDF Returning an Error Value: How to? | Excel Programming |