Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.misc
|
|||
|
|||
Macro to add data
I want a macro to carry my information from a form into a spreadsheet. The
data needs to go into the first line of the spreadsheet each time new data is entered on the form. In the spreadsheet itself, I need to add a row, moving existing data into the rows below, and add whatever new data id obtained from the form. Once that is done, I need to clear the form. -- Arlene |
#2
Posted to microsoft.public.excel.misc
|
|||
|
|||
Macro to add data
hi
assuming that you are using a standard userform from the vb editor...... you will need a line like this for each of your controls that you have entered data into and want that data to go to the sheet. Range("A65000").End(xlUp).Offset(1, 0).Value = TextBox1.Value then to clear the form you would need a line like this for each control to clear the control...... TextBox1.Value = "" i assume that all these lines would go into a commandbutton_click event. post back if questions. Regards FSt1 "Arlene" wrote: I want a macro to carry my information from a form into a spreadsheet. The data needs to go into the first line of the spreadsheet each time new data is entered on the form. In the spreadsheet itself, I need to add a row, moving existing data into the rows below, and add whatever new data id obtained from the form. Once that is done, I need to clear the form. -- Arlene |
#3
Posted to microsoft.public.excel.misc
|
|||
|
|||
Macro to add data
forgot to add
adjust the range for each line of code to the column you want the data to go into. regards FSt1 "FSt1" wrote: hi assuming that you are using a standard userform from the vb editor...... you will need a line like this for each of your controls that you have entered data into and want that data to go to the sheet. Range("A65000").End(xlUp).Offset(1, 0).Value = TextBox1.Value then to clear the form you would need a line like this for each control to clear the control...... TextBox1.Value = "" i assume that all these lines would go into a commandbutton_click event. post back if questions. Regards FSt1 "Arlene" wrote: I want a macro to carry my information from a form into a spreadsheet. The data needs to go into the first line of the spreadsheet each time new data is entered on the form. In the spreadsheet itself, I need to add a row, moving existing data into the rows below, and add whatever new data id obtained from the form. Once that is done, I need to clear the form. -- Arlene |
#4
Posted to microsoft.public.excel.misc
|
|||
|
|||
Macro to add data
This is the code that I have and what happens is that the top row is
replaced, not copied down Sub AddRecord() ' ' AddRecord Macro ' ' Keyboard Shortcut: Ctrl+Shift+R ' Selection.EntireRow.Insert , CopyOrigin:=xlFormatFromLeftOrAbove ActiveCell.Offset(-1, 0).Range("A1:G1").Select Selection.Copy Application.Goto Reference:="Bottom" ActiveCell.Offset(-1, 0).Range("A1").Select Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _ :=False, Transpose:=False Application.CutCopyMode = False Sheets("Sheet1").Select End Sub -- Arlene "FSt1" wrote: forgot to add adjust the range for each line of code to the column you want the data to go into. regards FSt1 "FSt1" wrote: hi assuming that you are using a standard userform from the vb editor...... you will need a line like this for each of your controls that you have entered data into and want that data to go to the sheet. Range("A65000").End(xlUp).Offset(1, 0).Value = TextBox1.Value then to clear the form you would need a line like this for each control to clear the control...... TextBox1.Value = "" i assume that all these lines would go into a commandbutton_click event. post back if questions. Regards FSt1 "Arlene" wrote: I want a macro to carry my information from a form into a spreadsheet. The data needs to go into the first line of the spreadsheet each time new data is entered on the form. In the spreadsheet itself, I need to add a row, moving existing data into the rows below, and add whatever new data id obtained from the form. Once that is done, I need to clear the form. -- Arlene |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Excel OLE data in PPT reverting to OLD data after macro updation | Charts and Charting in Excel | |||
Macro to move data to different column based on data in another co | Excel Discussion (Misc queries) | |||
is it possible to execute write to the fields in another .xsl form a macro in another .xsl? e.g. some way to load another .xsl into an .xsl macro and write to its data? | Excel Worksheet Functions | |||
enter data in cell which will start macro to move data to sheet2 | Excel Discussion (Misc queries) | |||
Using a MACRO to sort data | Excel Worksheet Functions |