Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Using forms to store data


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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Using forms to store data


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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 57
Default Using forms to store data

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 57
Default Using forms to store data

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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Is there a way to use the P.O. template and collect/store data. Leebob Excel Discussion (Misc queries) 0 April 13th 07 01:46 PM
store inventory sheet(ex:sports equipment store) vardan Excel Worksheet Functions 1 October 11th 06 12:51 AM
How to store hidden binary data? Ahmad[_3_] Excel Programming 3 April 19th 05 10:11 AM
Store Hidden Data in the Cell Yishi Excel Programming 2 December 12th 03 11:57 AM
Using controls in excel to store data Pat[_9_] Excel Programming 0 November 23rd 03 05:40 PM


All times are GMT +1. The time now is 08:52 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"