Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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. |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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. |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Line Continuation issue | Excel Worksheet Functions | |||
Line continuation. | Excel Programming | |||
line continuation | Excel Programming | |||
Line Continuation in combination chart | Charts and Charting in Excel | |||
Line continuation error | Excel Programming |