ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Add a VBA Module from a String instead of from a file (https://www.excelbanter.com/excel-programming/406704-add-vba-module-string-instead-file.html)

[email protected][_2_]

Add a VBA Module from a String instead of from a file
 
If I have

Dim v as String
v = "Sub test() " + chr(10) + "MsgBox 33333" + chr(10) + "End Sub"

Is there a way to add a new module and insert the Sub test from the
string variable v ?

Thanks.

RB Smissaert

Add a VBA Module from a String instead of from a file
 
I don't think there will be any problem with that.
If there is then write the string to a file first.
Read this: http://www.cpearson.com/excel/vbe.aspx

RBS


wrote in message
...
If I have

Dim v as String
v = "Sub test() " + chr(10) + "MsgBox 33333" + chr(10) + "End Sub"

Is there a way to add a new module and insert the Sub test from the
string variable v ?

Thanks.




All times are GMT +1. The time now is 12:09 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com