![]() |
Line continuation
Hi,
XL2003 I cannot use the < space Underscore line continuation on the following line without generating an error. Range("A1") = "=SUMPRODUCT(--(B$2:B$445=B2)*(C$2:C$445=C2)*(D$2:D$445=D2)*(G$2: G$445=G2)*(H$2:H$445=H2)*(I$2:I$445=I2))" The line works ok in its current state. What am I doing wrong? Regards - Dave. |
Line continuation
Hi Dave,
You can't insert a line break in a string enclosed in double quotes. You have to close off the double quotes, insert an ampersand (&) then space and underscore and then on the next line open the double quotes again. In other words, break the string up into smaller strings and concatenate them with the ampersand and then place the linebreak either before or after the ampersand. Range("A1") = "=SUMPRODUCT(--(B$2:B$445=B2)*" & _ "(C$2:C$445=C2)*(D$2:D$445=D2)*(G$2:G$445=G2)* " & _ "(H$2:H$445=H2)*(I$2:I$445=I2))" -- Regards, OssieMac "Dave" wrote: Hi, XL2003 I cannot use the < space Underscore line continuation on the following line without generating an error. Range("A1") = "=SUMPRODUCT(--(B$2:B$445=B2)*(C$2:C$445=C2)*(D$2:D$445=D2)*(G$2: G$445=G2)*(H$2:H$445=H2)*(I$2:I$445=I2))" The line works ok in its current state. What am I doing wrong? Regards - Dave. |
Line continuation
OK, thanks. Didn't know there were rules for using the line break in VBA.
Sorry about the repeated posts. As you say, a problem with the site. Dave. |
All times are GMT +1. The time now is 06:50 PM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com