M
Mauro
I have the following code:
Range("A2").Select
ActiveWorkbook.Sheets("Main").Activate
Range("A2").Select
Do
If IsEmpty(ActiveCell) = False Then
ActiveCell.Offset(1, 0).Select
End If
Loop Until IsEmpty(ActiveCell) = True
ActiveCell.Value = txtData.Value
ActiveCell.Offset(0, 1) = UCase(txtPax.Value)
ActiveCell.Offset(0, 2) = txtDeparture.Value
ActiveCell.Offset(0, 3) = UCase(txtTratta.Value)
ActiveCell.Offset(0, 4) = txtTariffa.Value
ActiveCell.Offset(0, 5).Value = (txtTasse.Value) - (txtTariffa.Value)
ActiveCell.Offset(0, 6) = UCase(txtAgente.Value)
I need to introduce a variation to this, namely:
if txtTariffa.Value=0 (or empty) then "PT" else
ActiveCell.Offset(0, 5).Value = (txtTasse.Value) - (txtTariffa.Value)
What is the right way to make it work?
thanks
mauro
Range("A2").Select
ActiveWorkbook.Sheets("Main").Activate
Range("A2").Select
Do
If IsEmpty(ActiveCell) = False Then
ActiveCell.Offset(1, 0).Select
End If
Loop Until IsEmpty(ActiveCell) = True
ActiveCell.Value = txtData.Value
ActiveCell.Offset(0, 1) = UCase(txtPax.Value)
ActiveCell.Offset(0, 2) = txtDeparture.Value
ActiveCell.Offset(0, 3) = UCase(txtTratta.Value)
ActiveCell.Offset(0, 4) = txtTariffa.Value
ActiveCell.Offset(0, 5).Value = (txtTasse.Value) - (txtTariffa.Value)
ActiveCell.Offset(0, 6) = UCase(txtAgente.Value)
I need to introduce a variation to this, namely:
if txtTariffa.Value=0 (or empty) then "PT" else
ActiveCell.Offset(0, 5).Value = (txtTasse.Value) - (txtTariffa.Value)
What is the right way to make it work?
thanks
mauro