![]() |
![]() |
|
|||||||
| Excel Questions All Excel/VBA questions - formulas, macros, pivot tables, general help, etc. Please post to this forum in English only. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
New Member
Join Date: Apr 2002
Posts: 26
|
Hi,
I have CommandButton2 & CommandButton3 on a MultiPage Control on a Form. Since the form is quite large, somtimes a user does not have to enter info for all of them. What I want to do is have Commandbutton3 which is on page 2 of multipage control update the worksheet the same way CommandButton2(page4)would. A sample of my code follows. I have left out some since the coding is a lot. Dim Lastrow as object Set LastRow = Sheet1.Range("a65536").End(xlUp) LastRow.Offset(1, 0).Value = Polno.Text LastRow.Offset(1, 1).Value = Claimno.Text Click CommandButton2 and get the following. MsgBox "One record written to Marine Claims" response = MsgBox("Do you want to add another record?", _ vbYesNo) If response = vbYes Then Polno.Text = "" Claimno.Text = "" MultiPage1.Value = 0 Polno.SetFocus Else For Each w In Application.Workbooks w.Save Next w Application.Quit End If End Sub Any help would be appreciated. Mareene |
|
|
|
|
|
#2 |
|
Board Regular
Join Date: Mar 2002
Location: Cincinnati, Ohio, USA
Posts: 6,824
|
Hi
Sub Commandbutton3_Click() Commandbutton2_Click End Sub Tom |
|
|
|
|
|
#3 |
|
New Member
Join Date: Apr 2002
Posts: 26
|
Thanks Tom,
I did not think that it would have been so simple. There I was writing all sorts of coding to get it to work. |
|
|
|
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|