Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,388
Default 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.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,510
Default 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.

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,388
Default 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.
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Line Continuation issue Bishop Excel Worksheet Functions 6 May 21st 09 01:47 PM
Line continuation. Dave Excel Programming 1 February 9th 09 03:40 PM
line continuation Dave Excel Programming 0 February 9th 09 05:39 AM
Line Continuation in combination chart CB Charts and Charting in Excel 2 June 24th 08 07:34 PM
Line continuation error Todd Huttenstine Excel Programming 4 July 29th 04 05:16 AM


All times are GMT +1. The time now is 09:32 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"