Previous Record and Next Record Macro Code Needed???

duckb00ts

New Member
Joined
May 15, 2011
Messages
2
I recently followed the following tutorial listed below to create a "userform":

http://www.contextures.com/xluserform01.html

I need a simple macro to add a "previous" and "next" button(s) in the userform that I have created. The data is currently input into the userform interface, and copied and/or transferred to another sheet in my workbook. I want the ability to view and/or make corrections to the record via userform interface only, without having to navigate to the sheet where the data is located, in order to view and/or make corrections. Any help regarding this matter is appreciated. Awaiting excel super-geeks to assist. Thanks.
 

Excel Facts

Remove leading & trailing spaces
Save as CSV to remove all leading and trailing spaces. It is faster than using TRIM().
You have a textbox/combobox linked to a cell on your sheet. Right? I don't understand what else you're trying to do. You want the user not to be able to change the values on the sheet by editing the sheet directly?

Select the sheet you don't want people screwing with. Press "Ctrl+A+A", then "Alt+O->E", click "Protection" and lock everything.

Open Excel's VB editor. Press "Ctrl+R" if the project explorer is not visible. Double-click on "ThisWorkbook". Paste the following:

Code:
Private Sub Workbook_Open()
 
Application.ScreenUpdating = False
 
With Sheets("[B]theSheet[/B]")
    .Activate
    .Unprotect
    .Protect userinterfaceonly:=True
    .EnableSelection = xlUnlockedCells
End With
 
End Sub

Put your sheet name in place of theSheet.
 
Upvote 0
Thanks for the prompt reply. I want the ability to be able to view the records and/or data that has been input into the userform via userform only, without having to navigate away from the userform to the sheet where the data is placed and/or stored. For example, if I want to view any previous data that has been input via userform, I need to go to the sheet where the data has been placed in order to view it. I want to add the "previous" and "next" buttons on the userform, so that I am able to navigate to prior records or next records that has been input via userform. Hope that makes sense. Thanks.
 
Upvote 0

Forum statistics

Threads
1,224,505
Messages
6,179,147
Members
452,891
Latest member
JUSTOUTOFMYREACH

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