Someone tell me the error for this coding please.If Worksheets("Vol").Column("A:B").Values <> "" Then
Someone tell me the error for this coding please.If Worksheets("Vol").Column("A:B").Values <> "" Then
As I said before, you cannot test multiple cells in this way.
Explain what you are trying to achieve, not do, achieve.
____________________________________________
Nihil simul inventum est et perfectum
Abusus non tollit usum
Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
James Thurber
"2.xls"
I am trying to put in all the values from "2.xls" into "1.xls".
Private Sub CommandButton1_Click()
I have this coding so far. It is taught by a kind soul from this forum.Dim oneCell As Range Dim rRow As Integer, DRow As Integer Dim aTemp As String Workbooks("2.xls").Activate rRow = Range("B65536").End(xlUp).Row For Each oneCell In Range("B1:B" & rRow).Cells aTemp = Application.VLookup(oneCell.Value, Workbooks("1.xls").Worksheets("Sheet1").Range("A:B"), 2, 0) If Not (IsError(aTemp)) Then If Not (IsError(Application.Match(aTemp, Range("D:D"), 0))) Then 'it matched the B cell with the D one on row DRow DRow = Application.Match(aTemp, Range("D:D"), 0) Workbooks("2.xls").Worksheets("Sheet1").Range("A:A").Copy Destination:=Workbooks("1.xls").Worksheets("Sheet1").Range("D1") End If End If Next End Sub
Oh no. So sorry, please refer to this new attached file instead of "1.xls".