Koda: Izberi vse
Dim currentItem As Integer
Public Sub PopraviSifro(sifra As Integer)
Application.ScreenUpdating = False
currentItem = sifra
DisplayInfo (currentItem)
Application.ScreenUpdating = True
End Sub
Private Sub DisplayInfo(i As Integer)
Dim sourceWS As Worksheet
Set sourceWS = Worksheets("Moji avti")
Application.ScreenUpdating = False
txtSifra.Text = sourceWS.Range("$A$" & i).Value
cmbZnamka.Text = sourceWS.Range("$B$" & i).Value
cmbTip.Text = sourceWS.Range("$C$" & i).Value
txtModel.Text = sourceWS.Range("$D$" & i).Value
cmbLetnik.Text = sourceWS.Range("$E$" & i).Value
txtProstornina.Text = sourceWS.Range("$F$" & i).Value
txtKw.Text = sourceWS.Range("$G$" & i).Value
txtKm.Text = sourceWS.Range("$H$" & i).Value
cmbGorivo.Text = sourceWS.Range("$I$" & i).Value
Application.ScreenUpdating = True
End Sub
Koda: Izberi vse
Private Sub btnEditCar_Click()
' + 2 == ListIndex = 0 -> ne obstaja, vrstice se zacnejo z 1 -> ListIndex + 1 -> Headerji v sifrantu
frmAvtoUredi.PopraviSifro cmbMyCar.ListIndex + 2
frmAvtoUredi.Show
RefreshData
End Sub
Prosim za pomoč, ker ne vem kaj je narobe, ker mi v nekem drugem makru omenjen del kode deluje normalno.
Hvala