jameshunt83
Board Regular
- Joined
- Oct 2, 2010
- Messages
- 149
Can any please help me correct this so it works. The debug shows the error as being on this line. One day I may get the hang of this VBA!
Code:
Private Sub Add1_Click()
Dim Matref As Variant, wb As Workbook
Dim i As Long
i = 1
Matref = Range("I7").Text
Set wb = Workbooks.Open("t:\shared\stocklist.xlsx")
With Rows(Matref)
Do Until Columns(i).Text = ""
i = i + 1
Loop
[COLOR="Red"]wb.Sheets("stock").Range(i, Matref).Value = Workbooks("stock.xlsm").Sheets("Stock-Control").Range("J7").Value[/COLOR]
End With
End Sub