Home |
Search |
Today's Posts |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Continuation of a macro | Excel Discussion (Misc queries) | |||
Line Continuation issue | Excel Worksheet Functions | |||
Line Continuation in combination chart | Charts and Charting in Excel | |||
formula continuation with the paint too. | New Users to Excel | |||
continuation from yesterday | Excel Discussion (Misc queries) |