Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() I have a form with the folowing text input fields; IDNumber Name Phone How do I store the data that I input using the form into an excel spreadsheet? or Must I use an access database for the same? -- oscarooko ------------------------------------------------------------------------ oscarooko's Profile: http://www.excelforum.com/member.php...o&userid=28116 View this thread: http://www.excelforum.com/showthread...hreadid=487407 |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() Good morning oscarooko The userform is only a "front end", the data can be stored in a normal worksheet, but must be written to the worksheet with the userform. Your information is a bit sparse so I can't give you much specific guidance, but say you have a button on your form, something lke this would write the contents of textbox1 to the currently active cell on the worksheet. ActiveCell.Value = TextBox1.Value HTH DominicB -- dominicb ------------------------------------------------------------------------ dominicb's Profile: http://www.excelforum.com/member.php...o&userid=18932 View this thread: http://www.excelforum.com/showthread...hreadid=487407 |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hello
I think the following will work. notes- correct path to file assumes code in diffrent workbook to data data book called Data.xls rename say sheet1 to data and add headings per your question in a1, b1 and c1 The code is attached to a command button on your user form. Private Sub CommandButton1_Click() Do Until issave = True Dim theBk As Workbook Set theBk = Workbooks.Open("C:\yourfolder\Data.xls") If theBk.ReadOnly Then theBk.Close False issave = False Else newrow =_ Workbooks("Data.xls").Sheets("data").Range("A65536 ").End(xlUp).Row + 1 Workbooks("Data.xls").Sheets("data").Cells(newrow, 1).Value_ = TextBox1.Value Workbooks("Data.xls").Sheets("data").Cells(newrow, 2).Value_ = TextBox2.Value Workbooks("Data.xls").Sheets("data").Cells(newrow, 3).Value_ = TextBox3.Value theBk.Close True MsgBox "Records Saved" TextBox1.Value = "" TextBox2.Value = "" TextBox3.Value = "" issave = True End If Loop End Sub -- Regards and Thanks for any assistance. Francis Brown. "oscarooko" wrote: I have a form with the folowing text input fields; IDNumber Name Phone How do I store the data that I input using the form into an excel spreadsheet? or Must I use an access database for the same? -- oscarooko ------------------------------------------------------------------------ oscarooko's Profile: http://www.excelforum.com/member.php...o&userid=28116 View this thread: http://www.excelforum.com/showthread...hreadid=487407 |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I should also add that my code was developed for multiple users to add data
via a form and it save into a file on a network drive. Hence the while until loop to test for the file being read/write available and only doing the save while it could do so. -- Regards Francis Brown. "Francis Brown" wrote: Hello I think the following will work. notes- correct path to file assumes code in diffrent workbook to data data book called Data.xls rename say sheet1 to data and add headings per your question in a1, b1 and c1 The code is attached to a command button on your user form. Private Sub CommandButton1_Click() Do Until issave = True Dim theBk As Workbook Set theBk = Workbooks.Open("C:\yourfolder\Data.xls") If theBk.ReadOnly Then theBk.Close False issave = False Else newrow =_ Workbooks("Data.xls").Sheets("data").Range("A65536 ").End(xlUp).Row + 1 Workbooks("Data.xls").Sheets("data").Cells(newrow, 1).Value_ = TextBox1.Value Workbooks("Data.xls").Sheets("data").Cells(newrow, 2).Value_ = TextBox2.Value Workbooks("Data.xls").Sheets("data").Cells(newrow, 3).Value_ = TextBox3.Value theBk.Close True MsgBox "Records Saved" TextBox1.Value = "" TextBox2.Value = "" TextBox3.Value = "" issave = True End If Loop End Sub -- Regards and Thanks for any assistance. Francis Brown. "oscarooko" wrote: I have a form with the folowing text input fields; IDNumber Name Phone How do I store the data that I input using the form into an excel spreadsheet? or Must I use an access database for the same? -- oscarooko ------------------------------------------------------------------------ oscarooko's Profile: http://www.excelforum.com/member.php...o&userid=28116 View this thread: http://www.excelforum.com/showthread...hreadid=487407 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Is there a way to use the P.O. template and collect/store data. | Excel Discussion (Misc queries) | |||
store inventory sheet(ex:sports equipment store) | Excel Worksheet Functions | |||
How to store hidden binary data? | Excel Programming | |||
Store Hidden Data in the Cell | Excel Programming | |||
Using controls in excel to store data | Excel Programming |