Nesting Functions in VBA?

  • Thread starter Thread starter prodsched
  • Start date Start date
P

prodsched

I have created a user form to input data to a worksheet. It has a numbe
of fields that correspond to columns and rows on the worksheet. It als
has three command buttons: OK, Cancel, and Clear that functio
properly.

My goal is to have this same worksheet updated by three different part
of the original user form. In other words, the original form would hav
"tabs", one for customer info, one for product info and the other fo
service info. As these "tabs" are updated the information is to b
added to the original line on the worksheet.

Unfortuantely, I have been unable to figure out how to make the "tab
command buttons call, or switch to, the other tabs.

Any suggestions would be most appreciated!

Thanks
 
To change tabs, you need to change the .Value property of the MultiPage
control. Use two CommandButtons, one to go to the next tab and the other
one to go to the previous tab.

Private Sub CommandButton1_Click()
'Go to the next tab
If MultiPage1.Value < MultiPage1.Pages.Count - 1 Then
MultiPage1.Value = MultiPage1.Value + 1
End If
End Sub

Private Sub CommandButton2_Click()
'Go to the previous tab
If MultiPage1.Value > 0 Then
MultiPage1.Value = MultiPage1.Value - 1
End If
End Sub

You can do some nifty coding, to enable or disable the command buttons as
appropriate too.

HTH,
Bernie
MS Excel MVP
 
Hello Bernie,

Thanks for the info. Unfortunately I still haven't figured it out
Perhaps a look at my code will help.

This user form is set up as a multipage. Again, I'm stuck as to how t
code the analysis, rework and other page.

Am I dense or what???

Thanks:confused

Attachment filename: rma log test.xls
Download attachment: http://www.excelforum.com/attachment.php?postid=53031
 
Back
Top