I was trying to input the code number and then copy the data from another worksheet with same code number
However, after I try this code, it shows type mismatch at
And I was try to input the "c", in to one column in another workbook(refer to different code)
However, after I try this code, it shows type mismatch at
I don't understand where is wrong, so anyone willing to help me?Private Sub Worksheet_Change(ByVal Target As Range)
Dim c As Integer
Dim rg As Range
Dim n As Long, count As Integer
If Target.Row > 1 And Target.Column = 1 Then
c = InputBox("Please enter the quantity.", "Stock Out")
n = Sheets("Master chart").Range("a65535").Row
Set sh = Sheets("Master Chart")
For i = 8 To n
If sh.Cells(i, 25) = Sheet5.Columns(1) Then
Application.SendKeys "{Enter}"
count = count + 1
Set rg = sh.Range("B" & i & ":D" & i)
rg.Copy Sheets("Stock Out").Range("A" & (count + 2))
Sheet5.Columns(4).Value = c
End If
Next
End If
End Sub
And I was try to input the "c", in to one column in another workbook(refer to different code)