Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
1 form containing 1 frame. Within the frame are labels and textboxes, with
the idea that labels are fixed, and users simply enter their data in the adjacent textboxes. So far I have no code, but I will show the form via an addin's menu. Q1: how do I return the user from the form (ie back to the addin)? Q2: how does the user save the form? Q3: how does the user print the form? Any help would be much appreciated. Regards. |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Private Sub CommandButton1_click()
Userform1.PrintForm unload me End Sub write the data somewhere. You don't save the userform. -- Regards, Tom Ogilvy "Stuart" wrote in message ... 1 form containing 1 frame. Within the frame are labels and textboxes, with the idea that labels are fixed, and users simply enter their data in the adjacent textboxes. So far I have no code, but I will show the form via an addin's menu. Q1: how do I return the user from the form (ie back to the addin)? Q2: how does the user save the form? Q3: how does the user print the form? Any help would be much appreciated. Regards. |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
If you mean that you want to preserve whatever was on the form when you say
save it, then you will have to save all of the textbox, combobox values etc onto a worksheet in the addin, and next time the form is shown, then you load the form from that worksheet data. -- HTH RP (remove nothere from the email address if mailing direct) "Stuart" wrote in message ... 1 form containing 1 frame. Within the frame are labels and textboxes, with the idea that labels are fixed, and users simply enter their data in the adjacent textboxes. So far I have no code, but I will show the form via an addin's menu. Q1: how do I return the user from the form (ie back to the addin)? Q2: how does the user save the form? Q3: how does the user print the form? Any help would be much appreciated. Regards. |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Many thanks for the reply.
So I have to place a 'Print' button on the Form for the user to click? Will this show up in the print? Regards. "Tom Ogilvy" wrote in message ... Private Sub CommandButton1_click() Userform1.PrintForm unload me End Sub write the data somewhere. You don't save the userform. -- Regards, Tom Ogilvy "Stuart" wrote in message ... 1 form containing 1 frame. Within the frame are labels and textboxes, with the idea that labels are fixed, and users simply enter their data in the adjacent textboxes. So far I have no code, but I will show the form via an addin's menu. Q1: how do I return the user from the form (ie back to the addin)? Q2: how does the user save the form? Q3: how does the user print the form? Any help would be much appreciated. Regards. |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Many thanks for the reply, but I don't understand how to achieve that.
Regards. "Bob Phillips" wrote in message ... If you mean that you want to preserve whatever was on the form when you say save it, then you will have to save all of the textbox, combobox values etc onto a worksheet in the addin, and next time the form is shown, then you load the form from that worksheet data. -- HTH RP (remove nothere from the email address if mailing direct) "Stuart" wrote in message ... 1 form containing 1 frame. Within the frame are labels and textboxes, with the idea that labels are fixed, and users simply enter their data in the adjacent textboxes. So far I have no code, but I will show the form via an addin's menu. Q1: how do I return the user from the form (ie back to the addin)? Q2: how does the user save the form? Q3: how does the user print the form? Any help would be much appreciated. Regards. |
#6
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
In the Userform_Terminate event add code like
With ThisWorkbook.Worksheets("SaveForm") .Range("A1").Value = Me.Textbox1.Value .Range("A2").Value = Me.ComboBox1.Value 'etc. End With You will have to adapt to all the controls that you wsih to save, I can't possibly know all of that. To reload, just do the opposite in the Userform_Initilaize event With ThisWorkbook.Worksheets("SaveForm") Me.Textbox1.Value = .Range("A1").Value Me.ComboBox1.Value = .Range("A2").Value 'etc. End With One thing to be aware of is that loading the form in the initialize event like this can trigger control event code. -- HTH RP (remove nothere from the email address if mailing direct) "Stuart" wrote in message ... Many thanks for the reply, but I don't understand how to achieve that. Regards. "Bob Phillips" wrote in message ... If you mean that you want to preserve whatever was on the form when you say save it, then you will have to save all of the textbox, combobox values etc onto a worksheet in the addin, and next time the form is shown, then you load the form from that worksheet data. -- HTH RP (remove nothere from the email address if mailing direct) "Stuart" wrote in message ... 1 form containing 1 frame. Within the frame are labels and textboxes, with the idea that labels are fixed, and users simply enter their data in the adjacent textboxes. So far I have no code, but I will show the form via an addin's menu. Q1: how do I return the user from the form (ie back to the addin)? Q2: how does the user save the form? Q3: how does the user print the form? Any help would be much appreciated. Regards. |
#7
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Normally it would, but you could try
Private Sub Print_Click() Me.Print.Visible = False Userform1.PrintForm unload me End Sub If you don't want to unload the form after printing, just change that to Me.Print.Visible = True -- HTH RP (remove nothere from the email address if mailing direct) "Stuart" wrote in message ... Many thanks for the reply. So I have to place a 'Print' button on the Form for the user to click? Will this show up in the print? Regards. "Tom Ogilvy" wrote in message ... Private Sub CommandButton1_click() Userform1.PrintForm unload me End Sub write the data somewhere. You don't save the userform. -- Regards, Tom Ogilvy "Stuart" wrote in message ... 1 form containing 1 frame. Within the frame are labels and textboxes, with the idea that labels are fixed, and users simply enter their data in the adjacent textboxes. So far I have no code, but I will show the form via an addin's menu. Q1: how do I return the user from the form (ie back to the addin)? Q2: how does the user save the form? Q3: how does the user print the form? Any help would be much appreciated. Regards. |
#8
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Will give it a try.
Many thanks Regards. "Bob Phillips" wrote in message ... Normally it would, but you could try Private Sub Print_Click() Me.Print.Visible = False Userform1.PrintForm unload me End Sub If you don't want to unload the form after printing, just change that to Me.Print.Visible = True -- HTH RP (remove nothere from the email address if mailing direct) "Stuart" wrote in message ... Many thanks for the reply. So I have to place a 'Print' button on the Form for the user to click? Will this show up in the print? Regards. "Tom Ogilvy" wrote in message ... Private Sub CommandButton1_click() Userform1.PrintForm unload me End Sub write the data somewhere. You don't save the userform. -- Regards, Tom Ogilvy "Stuart" wrote in message ... 1 form containing 1 frame. Within the frame are labels and textboxes, with the idea that labels are fixed, and users simply enter their data in the adjacent textboxes. So far I have no code, but I will show the form via an addin's menu. Q1: how do I return the user from the form (ie back to the addin)? Q2: how does the user save the form? Q3: how does the user print the form? Any help would be much appreciated. Regards. |
#9
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Thanks for that.
Will post anew if need be. Thanks to you both. Regards. "Bob Phillips" wrote in message ... In the Userform_Terminate event add code like With ThisWorkbook.Worksheets("SaveForm") .Range("A1").Value = Me.Textbox1.Value .Range("A2").Value = Me.ComboBox1.Value 'etc. End With You will have to adapt to all the controls that you wsih to save, I can't possibly know all of that. To reload, just do the opposite in the Userform_Initilaize event With ThisWorkbook.Worksheets("SaveForm") Me.Textbox1.Value = .Range("A1").Value Me.ComboBox1.Value = .Range("A2").Value 'etc. End With One thing to be aware of is that loading the form in the initialize event like this can trigger control event code. -- HTH RP (remove nothere from the email address if mailing direct) "Stuart" wrote in message ... Many thanks for the reply, but I don't understand how to achieve that. Regards. "Bob Phillips" wrote in message ... If you mean that you want to preserve whatever was on the form when you say save it, then you will have to save all of the textbox, combobox values etc onto a worksheet in the addin, and next time the form is shown, then you load the form from that worksheet data. -- HTH RP (remove nothere from the email address if mailing direct) "Stuart" wrote in message ... 1 form containing 1 frame. Within the frame are labels and textboxes, with the idea that labels are fixed, and users simply enter their data in the adjacent textboxes. So far I have no code, but I will show the form via an addin's menu. Q1: how do I return the user from the form (ie back to the addin)? Q2: how does the user save the form? Q3: how does the user print the form? Any help would be much appreciated. Regards. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Questions should be simple please help | Excel Worksheet Functions | |||
Simple questions (I hope) | Excel Programming | |||
Simple Questions | Excel Programming | |||
Several simple questions | Excel Programming | |||
Simple VB and Excel questions | Excel Programming |