View values; ignore header database

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
 
G

Gert-Jan

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top