Hi,
I have a peace of code below using "If Then" and wondering how can I make it smaller using IIf function
In TextBox "Plate_TXT" I'm using number, so I need to use CDbl() format
The above code is running correctly, but I tried the one below, but I got an error, also tried CDate for another textbox and got an error
Can you please help me fixing it?
Many thanks in advanced
I have a peace of code below using "If Then" and wondering how can I make it smaller using IIf function
VBA Code:
If Not Me.Plate_TXT = "" Then
ws.Cells(nr, "D") = CDbl(Me.Plate_TXT)
End If
In TextBox "Plate_TXT" I'm using number, so I need to use CDbl() format
The above code is running correctly, but I tried the one below, but I got an error, also tried CDate for another textbox and got an error
VBA Code:
ws.Cells(nr, "D") = IIf(Me.Plate_TXT = "", "", CDbl(Me.Plate_TXT))
Can you please help me fixing it?
Many thanks in advanced