Hey all,
So I basically am terrible with strings... any help is greatly appreciated here. Really I just want to take a big long macro from activesheet.cells(1,1) and stick it in Module1.
So I know how to insert code one line at a time. Example:
However, I have no idea how to parse a string of:
Public Sub SayHello()
MsgBox strMessage
End Sub
programatically into what I need to loop through the above...
Anyone know how to split this up based on the returns or just know a way to dump it all in nice and easy?
Thanks!
P.S. I can't use the "from text file" approach due to some security issues.
So I basically am terrible with strings... any help is greatly appreciated here. Really I just want to take a big long macro from activesheet.cells(1,1) and stick it in Module1.
So I know how to insert code one line at a time. Example:
Code:
With ActiveWorkbook.VBProject.VBComponents("Module1").CodeModule
LineNum = .CountOfLines + 1
.InsertLines LineNum, "Public Sub SayHello()"
LineNum = LineNum + 1
.InsertLines LineNum, " MsgBox strMessage"
LineNum = LineNum + 1
.InsertLines LineNum, "End Sub"
End With
However, I have no idea how to parse a string of:
Public Sub SayHello()
MsgBox strMessage
End Sub
programatically into what I need to loop through the above...
Anyone know how to split this up based on the returns or just know a way to dump it all in nice and easy?
Thanks!
P.S. I can't use the "from text file" approach due to some security issues.