-
The only way I know to do this involves opening the workbook, inserting your data, and then closing it again.
I'd suggest setting the value of a variable as the filepath to your 'database' workbook:
[VBA]Dim wb As Workbook
Set wb = workbooks.open "FilePath"[/VBA]
Then you target the cell where you want to insert your userform data by declaring the workbook->worksheet->range you want to work with. Something like:
[VBA]wb.Sheet1.Range("A2").Value = Me.txtBox[/VBA]
The above code will put the value of the UserForm object named txtBox into cell A2 of worksheet 1 of the workbook you chose earlier.
Then you can save and close 'wb'
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules