Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I have a userform in a workbook and i want every time i fill in the form 1.to add a record in sheet1.xls (a1,b1.c1.d1.e1.and so on-in the same workbook) 2.and the same info in another sheet2.xls (b5,c8.d9 and so on ) and then print sheet2.xls
i know its a litlle bi tricky but can anyone help where can i find some userforms examples in the we |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I guess your main problem is adding to the end.
Here is an example adding two textboxes to a sheet With ActiveWorkbook.Worksheets("Sheet1") cNextRow = .Cells(Rows.Count,"A").End(xlUp).Row + 1 .Range("A" & cNextRow).Value = Textbox1.Text .Range("B & cNextRow).Value = Textbox2Text End With This code would go in the userform module, triggered by a commandbutton say. Bob Phillips ... looking out across Poole Harbour to the Purbecks (remove nothere from the email address if mailing direct) "jimapos" wrote in message ... I have a userform in a workbook and i want every time i fill in the form 1.to add a record in sheet1.xls (a1,b1.c1.d1.e1.and so on-in the same workbook) 2.and the same info in another sheet2.xls (b5,c8.d9 and so on ) and then print sheet2.xls. i know its a litlle bi tricky but can anyone help? where can i find some userforms examples in the web |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() Thanks Bob for your help but there was an error on your answer. With ActiveWorkbook.Worksheets("Sheet1") cNextRow = .Cells(Rows.Count,"A").End(xlUp).Row + 1 .Range("A" & cNextRow).Value = Textbox1.Text .Range("B & cNextRow).Value = Textbox2.Text End With This code would go in the userform module, triggered by a commandbutton say. The last two lines give a red error ... Please sent me an example.xls with a userform if you can .If you cant ..thanks anyway. *** Sent via Developersdex http://www.developersdex.com *** Don't just participate in USENET...get rewarded for it! |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi Jim,
Corrected the errors, and here it is tied to the commandbutton Private Sub CommandButton1_Click() Dim cNextRow As Long With ActiveWorkbook.Worksheets("Sheet1") cNextRow = .Cells(Rows.Count, "A").End(xlUp).Row + 1 .Range("A" & cNextRow).Value = TextBox1.Text .Range("B" & cNextRow).Value = TextBox2.Text End With End Sub -- HTH Bob Phillips ... looking out across Poole Harbour to the Purbecks (remove nothere from the email address if mailing direct) "jim apos" wrote in message ... Thanks Bob for your help but there was an error on your answer. With ActiveWorkbook.Worksheets("Sheet1") cNextRow = .Cells(Rows.Count,"A").End(xlUp).Row + 1 .Range("A" & cNextRow).Value = Textbox1.Text .Range("B & cNextRow).Value = Textbox2.Text End With This code would go in the userform module, triggered by a commandbutton say. The last two lines give a red error ... Please sent me an example.xls with a userform if you can .If you cant .thanks anyway. *** Sent via Developersdex http://www.developersdex.com *** Don't just participate in USENET...get rewarded for it! |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
User Form Problem ??? | New Users to Excel | |||
User form problem | Excel Worksheet Functions | |||
User Form Problem | Excel Discussion (Misc queries) | |||
User Form Problem | Excel Discussion (Misc queries) | |||
problem with user form | Excel Programming |