I want CommandButton3 To Do What CommandButton2 Does

camalita

New Member
Joined
Apr 8, 2002
Messages
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
 

Excel Facts

Formula for Yesterday
Name Manager, New Name. Yesterday =TODAY()-1. OK. Then, use =YESTERDAY in any cell. Tomorrow could be =TODAY()+1.
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.
 
Upvote 0

Forum statistics

Threads
1,213,557
Messages
6,114,293
Members
448,564
Latest member
ED38

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top