Thebatfink
Active Member
- Joined
- Apr 8, 2007
- Messages
- 410
Hi,
Its probably really simple but I'm scratching my head. I am programically inserting formulas into workbooks, and the formula for this range of cells is quite long. It spills over a line in the VBA editor but for some reason I don't seem to be able to use the usual underscore to continue on the next line?!
For example
its obviously longer than that but if I put for example the underscore in and some quotes
it doesn't like it at all. I'd appreciate it if someone can kick me in the right direction!
Thanks!
Batfink
Its probably really simple but I'm scratching my head. I am programically inserting formulas into workbooks, and the formula for this range of cells is quite long. It spills over a line in the VBA editor but for some reason I don't seem to be able to use the usual underscore to continue on the next line?!
For example
Code:
sht.Range("AE" & rnumber & "").Formula = "=IF(OR($I" & rnumber & "="""",$AD" & rnumber & "=""""),"""",IF($I" & rnumber & "=""BLAHBLAHBLAHBLAH"",""BLAHBLAHBLAH"",IF(LEFT($I" & rnumber & ",2)=""BLAH"",""BLAHBLAH"",IF($I" & rnumber & "-$AD" & rnumber & "<=-1,""Yes"",""No"".......
its obviously longer than that but if I put for example the underscore in and some quotes
Code:
sht.Range("AE" & rnumber & "").Formula = "=IF(OR($I" & rnumber & "="""",$AD" & rnumber & "=""""),"""",IF($I" & rnumber & "=""BLAHBLAHBLAHBLAH"",""BLAHBLAHBLAH"",IF(LEFT($I" & rnumber & ",2)" _
"=""BLAH"",""BLAHBLAH"",IF($I" & rnumber & "-$AD" & rnumber & "<=-1,""Yes"",""No"".......
it doesn't like it at all. I'd appreciate it if someone can kick me in the right direction!
Thanks!
Batfink