S
sal21
... correct this please
My problem is:
.. if the during the scroll bar UP if find in cell B6 "DIP" Msg Bo
"attention init of list"
.. if the during the scroll bar DOWN find in column B the last cell
"" Msg Box "attention end list"
i have insert a line (uncomment) to make this but the routin dont wor
correctly...
Tks.
Code
-------------------
Private Sub ScrollBar1_Change()
ComboBox1 = ""
TextBox1 = ""
'If ScrollBar1.Min = 1 Then
'If Cells(ScrollBar1.Value + 6, 2) = "DIP" Then
'MsgBox "INIZIO ELENCO, IMPOSSIBILE PROSEGUIRE!", , "ATTENZIONE..."
'Exit Sub
'End If
'If Cells(ScrollBar1.Value + 6, 2) = "" Then
'MsgBox "FINE ELENCO, IMPOSSIBILE PROSEGUIRE!", , "ATTENZIONE..."
'Exit Sub
'End If
TextBox14 = Cells(ScrollBar1.Value + 6, 1)
TextBox2 = Cells(ScrollBar1.Value + 6, 17)
TextBox3 = Cells(ScrollBar1.Value + 6, 4)
TextBox4 = Cells(ScrollBar1.Value + 6, 5)
TextBox5 = Cells(ScrollBar1.Value + 6, 7)
TextBox6 = Cells(ScrollBar1.Value + 6, 8)
TextBox7 = Cells(ScrollBar1.Value + 6, 9)
TextBox9 = Cells(ScrollBar1.Value + 6, 2)
TextBox13 = Cells(ScrollBar1.Value + 6, 10)
TextBox30 = Cells(ScrollBar1.Value + 6, 11)
TextBox16 = Cells(ScrollBar1.Value + 6, 12)
TextBox18 = Cells(ScrollBar1.Value + 6, 20)
TextBox21 = Cells(ScrollBar1.Value + 6, 6)
TextBox20 = Cells(ScrollBar1.Value + 6, 14)
TextBox31 = Cells(ScrollBar1.Value + 6, 15)
TextBox32 = Cells(ScrollBar1.Value + 6, 16)
TextBox33 = Cells(ScrollBar1.Value + 6, 18)
TextBox34 = Format(Cells(ScrollBar1.Value + 6, 21), "##,##0.00")
TextBox35 = Cells(ScrollBar1.Value + 6, 22)
TextBox38 = Cells(ScrollBar1.Value + 6, 23)
Dim TROVATO As Boolean
Dim I As Integer
Dim A As String
TROVATO = False
For I = 2 To 50
A = Trim(Str(Sheets("DB AGENZIE").Cells(I, 1)))
If Right(TextBox9, 4) = Trim(Str(Sheets("DB AGENZIE").Cells(I, 1))) Then
TextBox27 = Sheets("DB AGENZIE").Cells(I, 2)
TextBox11 = Sheets("DB AGENZIE").Cells(I, 3)
TROVATO = True
Exit For
End If
Next I
Dim IX As Integer
Dim AX As String
TROVATO = False
For IX = 2 To 1500
AX = Trim(Str(Sheets("DB AGENZIE").Cells(IX, 4)))
If Right(TextBox20, 4) = Trim(Str(Sheets("DB AGENZIE").Cells(IX, 4))) Then
TextBox36 = Sheets("DB AGENZIE").Cells(IX, 5)
TROVATO = True
Exit For
End If
Next IX
Dim IY As Integer
Dim AY As String
TROVATO = False
For IY = 2 To 50
AY = Trim(Str(Sheets("DB AGENZIE").Cells(IY, 1)))
If Right(TextBox13, 4) = Trim(Str(Sheets("DB AGENZIE").Cells(IY, 1))) Then
TextBox37 = Sheets("DB AGENZIE").Cells(IY, 3)
TROVATO = True
Exit For
End If
Next IY
End Sub
My problem is:
.. if the during the scroll bar UP if find in cell B6 "DIP" Msg Bo
"attention init of list"
.. if the during the scroll bar DOWN find in column B the last cell
"" Msg Box "attention end list"
i have insert a line (uncomment) to make this but the routin dont wor
correctly...
Tks.
Code
-------------------
Private Sub ScrollBar1_Change()
ComboBox1 = ""
TextBox1 = ""
'If ScrollBar1.Min = 1 Then
'If Cells(ScrollBar1.Value + 6, 2) = "DIP" Then
'MsgBox "INIZIO ELENCO, IMPOSSIBILE PROSEGUIRE!", , "ATTENZIONE..."
'Exit Sub
'End If
'If Cells(ScrollBar1.Value + 6, 2) = "" Then
'MsgBox "FINE ELENCO, IMPOSSIBILE PROSEGUIRE!", , "ATTENZIONE..."
'Exit Sub
'End If
TextBox14 = Cells(ScrollBar1.Value + 6, 1)
TextBox2 = Cells(ScrollBar1.Value + 6, 17)
TextBox3 = Cells(ScrollBar1.Value + 6, 4)
TextBox4 = Cells(ScrollBar1.Value + 6, 5)
TextBox5 = Cells(ScrollBar1.Value + 6, 7)
TextBox6 = Cells(ScrollBar1.Value + 6, 8)
TextBox7 = Cells(ScrollBar1.Value + 6, 9)
TextBox9 = Cells(ScrollBar1.Value + 6, 2)
TextBox13 = Cells(ScrollBar1.Value + 6, 10)
TextBox30 = Cells(ScrollBar1.Value + 6, 11)
TextBox16 = Cells(ScrollBar1.Value + 6, 12)
TextBox18 = Cells(ScrollBar1.Value + 6, 20)
TextBox21 = Cells(ScrollBar1.Value + 6, 6)
TextBox20 = Cells(ScrollBar1.Value + 6, 14)
TextBox31 = Cells(ScrollBar1.Value + 6, 15)
TextBox32 = Cells(ScrollBar1.Value + 6, 16)
TextBox33 = Cells(ScrollBar1.Value + 6, 18)
TextBox34 = Format(Cells(ScrollBar1.Value + 6, 21), "##,##0.00")
TextBox35 = Cells(ScrollBar1.Value + 6, 22)
TextBox38 = Cells(ScrollBar1.Value + 6, 23)
Dim TROVATO As Boolean
Dim I As Integer
Dim A As String
TROVATO = False
For I = 2 To 50
A = Trim(Str(Sheets("DB AGENZIE").Cells(I, 1)))
If Right(TextBox9, 4) = Trim(Str(Sheets("DB AGENZIE").Cells(I, 1))) Then
TextBox27 = Sheets("DB AGENZIE").Cells(I, 2)
TextBox11 = Sheets("DB AGENZIE").Cells(I, 3)
TROVATO = True
Exit For
End If
Next I
Dim IX As Integer
Dim AX As String
TROVATO = False
For IX = 2 To 1500
AX = Trim(Str(Sheets("DB AGENZIE").Cells(IX, 4)))
If Right(TextBox20, 4) = Trim(Str(Sheets("DB AGENZIE").Cells(IX, 4))) Then
TextBox36 = Sheets("DB AGENZIE").Cells(IX, 5)
TROVATO = True
Exit For
End If
Next IX
Dim IY As Integer
Dim AY As String
TROVATO = False
For IY = 2 To 50
AY = Trim(Str(Sheets("DB AGENZIE").Cells(IY, 1)))
If Right(TextBox13, 4) = Trim(Str(Sheets("DB AGENZIE").Cells(IY, 1))) Then
TextBox37 = Sheets("DB AGENZIE").Cells(IY, 3)
TROVATO = True
Exit For
End If
Next IY
End Sub