I am trying to write some code whereby if a checkbox is true it will add the info to a stock sheet (which is fine), also if an item from the stock sheet is sold it marks it as yes and should later delete the item. (also fine), However the two do not seem to work together, if I need to add stock and remove stock.
I have the following code:
Which works fine. Followed by this (which checks for the sold item):
but together the first section of code does not work after the line:
Please can someone help?
The other vital code maybe:
I have the following code:
Code:
If ChkPEx.Value = True Then
'Sheets("Stock").Select
Range("A2").Select
Do
If IsEmpty(ActiveCell) = False Then
ActiveCell.Offset(1, 0).Select
End If
Loop Until IsEmpty(ActiveCell) = True
ActiveCell.Value = TxtPXReg
ActiveCell.Offset(0, 1) = TxtPXMk
ActiveCell.Offset(0, 2) = TxtPXAmt
ActiveCell.Offset(0, 3) = TxtTo
Else
GoTo continue
End If
Code:
Sheets("Stock").Select
Range("E1").Select
Do
If ActiveCell.Value <> "Yes" Then
ActiveCell.Offset(1, 0).Select
End If
Loop Until ActiveCell.Value = "Yes"
ActiveCell.Select
Selection.EntireRow.Delete
Code:
ActiveCell.Value = TxtPXReg
Please can someone help?
The other vital code maybe:
Code:
Private Sub CMBStk_Change()
Sheets("Sheet1").Select
Range("A35").Select
ActiveCell.Value = CMBStk
TxtFrm.Text = Sheets("Sheet1").Range("B35").Text
TxtCost.Text = Sheets("Sheet1").Range("C35").Text
Sheets("Stock").Select
Range("A1").Select
Do
If ActiveCell.Value <> Sheets("Sheet1").Range("A35") Then
ActiveCell.Offset(1, 0).Select
End If
Loop Until ActiveCell.Value = Sheets("Sheet1").Range("A35")
ActiveCell.Offset(0, 4) = "Yes"
Sheets("Sheet1").Select
Range("A2").Select
End Sub