Share via

Next and Previous Buttons using Data Validation List

Anonymous
2022-03-29T10:51:43+00:00

I have a typical data validation list in cell "P3" with about 28names to choose from. I'd like to have two buttons on the spreadsheet next to the drop down list that will allow the user to select the next name (i.e. open the dropdown list and scroll down one name) and the other button that will be called previous (i.e. select the dropdown list and scroll up one name).
Cells P2 and P4 respectively contains:
=INDEX(Sheet1!$G$2:$G$28,IF(MATCH(P3,Sheet1!$G$2:$G$28,0)-1<1,Sheet1!$G$28,MATCH(P3,Sheet1!$G$2:$G$28,0)-1))
=INDEX(Sheet1!$G$2:$G$28,IF(MATCH(P3,Sheet1!$G$2:$G$28,0)>ROW(Sheet1!$G$28)-ROW(Sheet1!$G$2),Sheet1!$G$2,MATCH(P3,Sheet1!$G$2:$G$28,0)+1))

Guidance required!

Note: I am already using a Macro to print all result cards on one click.

Microsoft 365 and Office | Excel | Other | Windows

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments

2 answers

Sort by: Most helpful
  1. Anonymous
    2022-03-29T12:41:58+00:00

    Hello Mr. Ian,

    Thank so much!

    I don't know personal request is allowed here or not!

    Actually I am new to VB so can't follow the method. Can you pls solve this problem for me?

    Sample file is here

    Sample File

    Was this answer helpful?

    0 comments No comments
  2. Anonymous
    2022-03-29T11:43:23+00:00

    Hi M, hope you're doing well. I’m Ian, and I’m happy to help you today.

    It is quite tricky based on the data you have right now.

    But since you already have the formula for the Previous and Next Data, you just need to call this one for the Next and Previous button that you have.

    In the code, this will look something like this one.

    Private Sub NextBtn_Click() 'moves to next
    Range("P3") = Range("P4")
    End Sub
    
    Private Sub PrevBtn_Click() 'moves to previous
    Range("P3") = Range("P2")
    End Sub
    

    This is a user-to-user support forum and I am a fellow user.

    I hope this helps, but please let me know if you need anything else.

    Was this answer helpful?

    0 comments No comments