confused in Frankfurt
Board Regular
- Joined
- Oct 11, 2010
- Messages
- 53
Hello,
I have two workbooks which I have defined oldfile and newfile
in the old file I have defined vrange to be used for vlookup
the worksheet name in both files is called "South Africa"
I want to create a vlookup formula using the defined name, range
Sub
workbooks (newfile).Activate
cells(3,13)activate
I tried two forms of Vlookup neither work
1)
On Error Resume Next
x = Application.WorksheetFunction.VLookup(Cell.Offset(0, -12).Value, _
Workbooks(oldfile).Worksheets("South Africa").Range(vrange), 13, 0)
If Err.Number <> 0 Then
Cell.Offset(1, 0).Select
Else
Cell.Value = x
End If
2)
On Error Resume Next
Active cell.formulaR1C1= _
"=vlookup(RC[-12], workbooks(oldfile).worksheets("South Africa").Range(vrange),13,0)
next cell
Appreciate your help
I have two workbooks which I have defined oldfile and newfile
in the old file I have defined vrange to be used for vlookup
the worksheet name in both files is called "South Africa"
I want to create a vlookup formula using the defined name, range
Sub
workbooks (newfile).Activate
cells(3,13)activate
I tried two forms of Vlookup neither work
1)
On Error Resume Next
x = Application.WorksheetFunction.VLookup(Cell.Offset(0, -12).Value, _
Workbooks(oldfile).Worksheets("South Africa").Range(vrange), 13, 0)
If Err.Number <> 0 Then
Cell.Offset(1, 0).Select
Else
Cell.Value = x
End If
2)
On Error Resume Next
Active cell.formulaR1C1= _
"=vlookup(RC[-12], workbooks(oldfile).worksheets("South Africa").Range(vrange),13,0)
next cell
Appreciate your help