Formula within formula

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I think this is quite a simple one

i am using a macro to put a formula in a cell, however as it contains speech marks (") it does not work, is there a way to get it to understand the speechmarks within the outer speech marks are part of the formula i want typed in the cell

Worksheets("Customer Form").Range("C13").Formula = "=IF(Data!K11 = "New Manager", "Please Overtype With Name Of New Manager","")"
 
"=IF(Data!K11 = ""New Manager"", ""Please Overtype With Name Of New
Manager"","""")"

verify in the immediate window:

? "=IF(Data!K11 = ""New Manager"", ""Please Overtype With Name Of New
Manager"","""")"
=IF(Data!K11 = "New Manager", "Please Overtype With Name Of New Manager","")

so a doubled speech marks within a string produce a single speech mark.

--
Regards,
Tom Ogilvy

Emma Hope said:
I think this is quite a simple one,

i am using a macro to put a formula in a cell, however as it contains
speech marks (") it does not work, is there a way to get it to understand
the speechmarks within the outer speech marks are part of the formula i want
typed in the cell?
Worksheets("Customer Form").Range("C13").Formula = "=IF(Data!K11 = "New
Manager", "Please Overtype With Name Of New Manager","")"
 
Emma,

Try this:

Worksheets("Customer Form").Range("C13").Formula = _
"=IF(Data!K11 = ""New Manager"", ""Please Overtype With Name Of New
Manager"","""")"


John

Emma Hope said:
I think this is quite a simple one,

i am using a macro to put a formula in a cell, however as it contains
speech marks (") it does not work, is there a way to get it to understand
the speechmarks within the outer speech marks are part of the formula i want
typed in the cell?
Worksheets("Customer Form").Range("C13").Formula = "=IF(Data!K11 = "New
Manager", "Please Overtype With Name Of New Manager","")"
 
Back
Top