Te anexo la macro
Private Sub CommandButton2_Click()
'Por.Dante Amor
'Anterior
Set h1 = Sheets("Hoja1")
Set h2 = Sheets("Hoja2")
u = h2.Range("A" & Rows.Count).End(xlUp).Row
If u = 1 And h2.Cells(u, "A") = "" Then
MsgBox "No hay registros a mostrar", vbCritical, "ANTERIOR"
Exit Sub
End If
'
If Label1 <> "" Then
If h2.[Y1] = "" Then
h2.[Y1] = Val(Label1)
End If
End If
f = u
Set b = h2.Columns("X").Find("X", lookat:=xlWhole)
If Not b Is Nothing Then
If b.Row = 1 Then
ant = 1
MsgBox "Pregunta inicial", vbExclamation, "ANTERIOR"
Else
ant = b.Row - 1
h2.Cells(b.Row, "X") = ""
h2.Cells(ant, "X") = "X"
End If
Else
h2.Cells(u, "X") = "X"
ant = u
End If
limpiar
y = h2.Cells(ant, "A")
'Toma la pregunta para mostrarla en el label
Set b = h1.Columns("A").Find(y, lookat:=xlWhole)
If Not b Is Nothing Then
Label1 = h1.Cells(b.Row, "A")
Label2 = h1.Cells(b.Row, "B")
Label3 = h1.Cells(b.Row + 1, "B")
For i = b.Row + 2 To h1.Range("B" & Rows.Count).End(xlUp).Row
If h1.Cells(i, "A") <> "" Then Exit For
ListBox1.AddItem h1.Cells(i, "B")
Next
For i = 0 To ListBox1.ListCount - 1
If h2.Cells(ant, i + 2) = "X" Then
ListBox1.Selected(i) = True
End If
Next
End If
'Poner foto
PonerFoto h1, Val(Label1)
End Sub
S a l u d o s . D a n t e A m o r