Is it possible to write code in vba that would automatically generate additional
code and create dynamic values.
Essentially I have vba code which uses ado to insert data into a newly created
worksheet. However, i want to be able to insert code that retains the connection
information so that the user can re-establish a connection another time. The
complication is that there is possibly more than one connection required
depending on the values output from the database. Therefore on one sheet 2 , 3 ,
4 etc recordsets may have been required to generate the sheet output. My code
would need to insert vba into the sheet as it was created and also be able to
identify the cells which refer to each recordset connection.