I am new to VBA and attempting to make something happen and it is not happening .
Here is the part that is not working. I think.
What I want this to do is
#1 to look into a cell and if the cell is full to compare it to the values and if they are same to place them in the cells to the right.
#2 Part that works is:
or look for and add them to the empty cells down
Code:
Private Sub EnterButton_Click()
ActiveWorkbook.Sheets("Activity").Activate
Cells(3, 1).Select
Do
If IsEmpty(ActiveCell) = False Then
If ActiveCell.Offset(0, 2).Value = CarrierComboBox And ActiveCell.Offset(0, 3).Value = TrailerTextBox Then
With ActiveCell
.Offset(0, 8) = Now
.Offset(0, 9) = StatusComboBox.Value
.Offset(0, 10) = NoteTextBox.Value
End With
End If
ActiveCell.Offset(1, 0).Select
End If
Loop Until IsEmpty(ActiveCell) = True
With ActiveCell
.Value = Now
.Offset(0, 2) = CarrierComboBox.Value
.Offset(0, 3) = TrailerTextBox.Value
.Offset(0, 4) = StatusComboBox.Value
.Offset(0, 5) = NoteTextBox.Value
End With
End Sub
Any input is appreciated.
Here is the part that is not working. I think.
What I want this to do is
#1 to look into a cell and if the cell is full to compare it to the values and if they are same to place them in the cells to the right.
#2 Part that works is:
or look for and add them to the empty cells down
Code:
Private Sub EnterButton_Click()
ActiveWorkbook.Sheets("Activity").Activate
Cells(3, 1).Select
Do
If IsEmpty(ActiveCell) = False Then
If ActiveCell.Offset(0, 2).Value = CarrierComboBox And ActiveCell.Offset(0, 3).Value = TrailerTextBox Then
With ActiveCell
.Offset(0, 8) = Now
.Offset(0, 9) = StatusComboBox.Value
.Offset(0, 10) = NoteTextBox.Value
End With
End If
ActiveCell.Offset(1, 0).Select
End If
Loop Until IsEmpty(ActiveCell) = True
With ActiveCell
.Value = Now
.Offset(0, 2) = CarrierComboBox.Value
.Offset(0, 3) = TrailerTextBox.Value
.Offset(0, 4) = StatusComboBox.Value
.Offset(0, 5) = NoteTextBox.Value
End With
End Sub
Any input is appreciated.