View values; ignore header database

  • Thread starter Thread starter Gert-Jan
  • Start date Start date
G

Gert-Jan

In a database (Sheet3) I have values in some columns. In row 1 there are
headers. I created a userform to view al the values. How should the userform
ignore the first line; the headers are not very interesting...

Private Sub ComboBox1_Change()
If Range("Sheet3!A2") = "" Then
Exit Sub
Else
Sheets("Sheet3").Select
Dim i As Long 'Index
i = ComboBox1.ListIndex + 1
vrijwap = Cells(i, 5).Value
....
....
volgende.Enabled = i < ComboBox1.ListCount
vorige.Enabled = i > 1
 
Problem solved:
Private Sub ComboBox1_Change()
If Range("Sheet3!A2") = "" Then
Exit Sub
Else
Sheets("Sheet3").Select
Dim i As Long 'Index
i = ComboBox1.ListIndex + 1
vrijwap = Cells(i +1, 5).Value
 
Back
Top