ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   View values; ignore header database (https://www.excelbanter.com/excel-programming/366194-view-values%3B-ignore-header-database.html)

Gert-Jan

View values; ignore header database
 
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



Gert-Jan

View values; ignore header database
 
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



"Gert-Jan" schreef in bericht
...
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






All times are GMT +1. The time now is 03:36 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com