Next and Previous
Results 1 to 2 of 2

Thread: Next and Previous
Thanks Thanks: 0 Likes Likes: 0

  1. #1
    Board Regular
    Join Date
    Feb 2013
    Posts
    63
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Next and Previous

    Afternoon all
    I am using the code below to populate a Userform from data held on "Project Master" Worksheet. I am trying to add a command button to transition to previous and next rows, but for some reason the code i tried either jumped me to the header row (row 1) of the "Project Master" worksheet or just did nothing. I have since deleted that code to try again.

    Can you help.

    Code:
    totRows = Worksheets("Project Master").Range("A1").CurrentRegion.Rows.count
    For i = 2 To totRows
        If Trim(Worksheets("Project Master").Cells(i, 1)) = Trim(CmbFindProject.text) Then
    TxtProject.text = Worksheets("Project Master").Cells(i, 1).value
    CmbTeam.text = Worksheets("Project Master").Cells(i, 2).value
    CmbCDTLead.text = Worksheets("Project Master").Cells(i, 3).value
    TxtDESTeam.text = Worksheets("Project Master").Cells(i, 4).value
    .etc....
    regards

    Steve

  2. #2
    Board Regular rpaulson's Avatar
    Join Date
    Oct 2007
    Location
    Fremont, OH USA
    Posts
    1,041
    Post Thanks / Like
    Mentioned
    5 Post(s)
    Tagged
    0 Thread(s)

    Default Re: Next and Previous

    try

    totRows = Worksheets("Project Master").Cells(Rows.Count, "A").End(xlUp).Row

    hth,

    Ross

Some videos you may like

User Tag List

Tags for this Thread

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •