CDbl Faktor <1 wird nicht übernommen
08.09.2020 10:30:53
Thomas
ich habe ein kleines Problem was wahrscheinlich der VBA Profi und 2 sec löst.
Ich habe ein User Form das Eingabe von 2 Artikelnnummern und einem Umrechnungsfaktor vorgibt.
Mein Problem bei Zahlen Bitte um Lösungen, Danke.
Hier noch der CODE:
Option Explicit
Private Sub CommandButton1_Click()
Dim loLetzte As Long, ws As Worksheet
Application.ScreenUpdating = False
If Me.TextBox1 "" And Me.TextBox2 "" And Me.TextBox3 "" Then
For Each ws In ActiveWorkbook.Worksheets
If WorksheetFunction.CountIf(ws.Columns(3), CDbl(Me.TextBox1)) = 0 Then
Else
With ws
loLetzte = .Cells(.Rows.Count, 3).End(xlUp).Row
.Range("C1:F" & loLetzte).AutoFilter Field:=1, Criteria1:=Me.TextBox1
.AutoFilter.Range.Offset(1).Resize(.AutoFilter.Range.Rows.Count - 1).Columns(1) _
_
_
_
_
_
_
.SpecialCells(xlCellTypeVisible).Value = CDbl(Me.TextBox2)
.AutoFilter.Range.Offset(1).Resize(.AutoFilter.Range.Rows.Count - 1).Columns(4) _
_
_
_
_
_
_
.SpecialCells(xlCellTypeVisible).Value = CDbl(Me.TextBox3)
.AutoFilterMode = False
End With
End If
Next ws
Unload Me
Else
MsgBox "Es sind nicht alle Eingabefleder befüllt."
Me.TextBox1.SetFocus
End If
End Sub
Private Sub CommandButton2_Click()
Unload Me
End Sub
Private Sub UserForm_Click()
End Sub
Schon mal Danke vorab