LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,080
Default Line continuation error

Split your long string into two or more substrings; then concatenate the
substrings:

substr1 = ..........
substr2 = ..........

..InsertLines LineNum, substr1 & substr2

--

Vasant



"Todd Huttenstine" wrote in message
...
'Code below creates a procedure in module Sheet1
Dim VBCodeMod As CodeModule
Dim LineNum As Long

Set VBCodeMod = Workbooks
("RDFMTD.xls").VBProject.VBComponents("Sheet1").Co deModule
With VBCodeMod
LineNum = .CountOfLines + 1
.InsertLines LineNum, _
"Private Sub Worksheet_Change(ByVal Target As
Excel.Range)" & Chr(13) & _
"Dim Counter As Long" & Chr(13) & _
"Dim TargetAddress" & Chr(13) & _
"On Error Resume Next" & Chr(13) & _
"Counter = Application.WorksheetFunction.CountA(Worksheets
(1).Range(" & Chr(34) & "K:K" & Chr(34) & "))" & Chr(13) &
_
"TargetValue = Target.Value" & Chr(13) & _
"Target = UCase(Target)" & Chr(13) & _
"TargetAddress = Target.Address" & Chr(13) & _
"TACL = Left(Target.Address(, 0), InStr(Target.Address(,
0), " & Chr(34) & "$" & Chr(34) & ") - 1)" & Chr(13) & _
"If TACL = " & Chr(34) & "Z" & Chr(34) & " Then" & Chr(13)
& _
"Target.Offset(1, -15).Select" & Chr(13) & _
"Else" & Chr(13) & _
"Set myRange = Intersect(Range(" & Chr(34) & "K2:K" & Chr
(34) & "& Counter), Target)" & Chr(13) & _
"If TargetValue = " & Chr(34) & "y" & Chr(34) & " Or
TargetValue = " & Chr(34) & "Y" & Chr(34) & " Then" & Chr
(13) & _
"Target.Offset(1, 0).Select" & Chr(13) & _
"Exit Sub" & Chr(13) & _
"Else" & Chr(13) & _
"End If" & Chr(13) & _
"If Not myRange Is Nothing Then" & Chr(13) & _
"Target.Offset(0, 15).Select" & Chr(13) & _
"SendKeys " & Chr(34) & "%{down}" & Chr(34) & Chr(13) & _
"End If" & Chr(13) & _
"End If" & Chr(13) & _
"End Sub"
End With
'-------------------------------------

Above is my code. It adds lines of code inside a module.
If I need to add more lines to the module I am adding
lines to by using this code, which in turn will mean I
need to add more lines of code to this code (code above),
would I be able to do this?


-----Original Message-----
Hey guys


I am getting the error "Too many line continuations" when
I try to add another line. I have 24 line continuations
and when I try to add a 25th, I get the error. Does
anyone know a work around because it just so happens I

was
able to get it to only 24 lines but in the future, I may
need 25 or more.


Thank you
Todd Huttenstine
.





 
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
Continuation of a macro Dan Wood Excel Discussion (Misc queries) 2 December 20th 09 11:54 AM
Line Continuation issue Bishop Excel Worksheet Functions 6 May 21st 09 01:47 PM
Line Continuation in combination chart CB Charts and Charting in Excel 2 June 24th 08 07:34 PM
formula continuation with the paint too. Fay New Users to Excel 2 March 17th 08 10:56 PM
continuation from yesterday Mindy Excel Discussion (Misc queries) 4 June 22nd 06 11:13 PM


All times are GMT +1. The time now is 02:49 PM.

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"