![]() |
Form info to different spreadsheet
I have two spreadsheet's. Test1.xls which is on my C:
Drive and another spreadsheet Test2.xls which is on my H: Drive both spreadsheets are in a file called temp. The spreadsheet on my C: Drive contains a user form that the user completes and then clicks on a button. I want that information to be put on the spreadsheet on my H:\ drive. For example I have a field on the form that the user inserts the date (txtdate) when they click on a macro I want it to take the date off the user form and insert it into cell A2 on spreadsheet H:\temp\test2.xls. I have asked before but nothing seems to work........ |
Form info to different spreadsheet
Hi Glenn,
Didn't test it, but it must work : You supposed to have a "Save" button on the form. Put this code in its Click event : Dim wbHDrive as Workbook If Me.txtdate.value<"" And Not IsNull(Me.txtdate) then Application.ScreenUpdating = False set wbHDrive = Workbooks.Open("H:\temp\test2.xls") With wbHDrive ..ActiveSheet.Range("A2") = Me.txtdate.Value ..Close True end with Application.ScreenUpdating = True end if --- Message posted from http://www.ExcelForum.com/ |
Form info to different spreadsheet
Glenn,
Straight off the top, in the C: file userform code Workbooks.Open Filename:="H:\temp\test2.xls" With Activeworkbook .Worksheets("Sheet1").Range("A2").Value = txtDate.Text .Save .Close End With -- HTH Bob Phillips ... looking out across Poole Harbour to the Purbecks (remove nothere from the email address if mailing direct) "Glenn" wrote in message ... I have two spreadsheet's. Test1.xls which is on my C: Drive and another spreadsheet Test2.xls which is on my H: Drive both spreadsheets are in a file called temp. The spreadsheet on my C: Drive contains a user form that the user completes and then clicks on a button. I want that information to be put on the spreadsheet on my H:\ drive. For example I have a field on the form that the user inserts the date (txtdate) when they click on a macro I want it to take the date off the user form and insert it into cell A2 on spreadsheet H:\temp\test2.xls. I have asked before but nothing seems to work........ |
All times are GMT +1. The time now is 06:51 AM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com