L
lykwid
private sub btnshowstock_click()
dim row as integer
row = 8
activeworkbook.sheets(\"current stock\").select
activesheet.range(\"a8\").select
do
*if activecell.value <> txtproductcode.value then*
ActiveCell.Offset(1, 0).Select
Row = Row + 1
If Row > 57 Then Exit Sub
End If
:: *Loop Until ActiveCell.Value = txtProductCode.Value*::
ActiveCell.Offset(0, 3).Value = txtCurrentStock.Value
End Sub
This code should run down column A until the value typed in the field
txtProductCode is found. It doesn't.
Instead, it goes until the Row is more than 57 and stops. I think the
rows I have highlighted are the problem as it doesn't seem to stop. Any
ideas anyone? Thanks.
dim row as integer
row = 8
activeworkbook.sheets(\"current stock\").select
activesheet.range(\"a8\").select
do
*if activecell.value <> txtproductcode.value then*
ActiveCell.Offset(1, 0).Select
Row = Row + 1
If Row > 57 Then Exit Sub
End If
:: *Loop Until ActiveCell.Value = txtProductCode.Value*::
ActiveCell.Offset(0, 3).Value = txtCurrentStock.Value
End Sub
This code should run down column A until the value typed in the field
txtProductCode is found. It doesn't.
Instead, it goes until the Row is more than 57 and stops. I think the
rows I have highlighted are the problem as it doesn't seem to stop. Any
ideas anyone? Thanks.