View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
RyanH RyanH is offline
external usenet poster
 
Posts: 586
Default "If" Formula in VBA

It may help to put this under the Workbook_NewSheet Event. Thought it may
help.

Private Sub Workbook_NewSheet(ByVal Sh As Object)

Sh.Range("B20").Formula = "=IF('Sign 2'!P650,'Sign 2'!E10,"""")"

End Sub

Ryan

"Aviashn" wrote:

Try doubling your double quotes within the string. VBA does not like
double quotes inside a string and the workaround is to use two double
quotes wherever there was one.

Range("B20").formula = "=IF('Sign 2'!P650,'Sign 2'!E10,"""")"

Post back if you still get an error.