VLOOKUP table_array parameter as a variable
Solved/Closed
NotSoEXCELlent
-
2 Aug 2011 à 19:38
rizvisa1 Posts 4478 Registration date Thursday 28 January 2010 Status Contributor Last seen 5 May 2022 - 3 Aug 2011 à 13:41
rizvisa1 Posts 4478 Registration date Thursday 28 January 2010 Status Contributor Last seen 5 May 2022 - 3 Aug 2011 à 13:41
Related:
- VLOOKUP table_array parameter as a variable
- Iserror function in excel with vlookup - Guide
- Transfer data from one excel worksheet to another automatically vlookup - Guide
- My documents environment variable - Guide
- Vlookup excel 2007 ✓ - Excel Forum
- Duckduckgo_search ddg safesearch parameter strict moderate off - Guide
1 response
rizvisa1
Posts
4478
Registration date
Thursday 28 January 2010
Status
Contributor
Last seen
5 May 2022
766
3 Aug 2011 à 05:55
3 Aug 2011 à 05:55
You mean some thing like this
lastrow = cells(rows.count, "A").end(xlup).row
lastcol =cells(1, columns.count).end(xltoleft).column
src = "R2C1:R" & lastrow & "C" & lastcol
ActiveCell.FormulaR1C1 = "=VLOOKUP(RC[-10],Position!" & src & ",2,FALSE)"
lastrow = cells(rows.count, "A").end(xlup).row
lastcol =cells(1, columns.count).end(xltoleft).column
src = "R2C1:R" & lastrow & "C" & lastcol
ActiveCell.FormulaR1C1 = "=VLOOKUP(RC[-10],Position!" & src & ",2,FALSE)"
3 Aug 2011 à 10:53
3 Aug 2011 à 11:08
3 Aug 2011 à 11:22
Dim src As String
Dim ws As Worksheet
Set ws = Sheets("Position")
lastRow = ws.Cells(Rows.Count, "A").End(xlUp).Row
lastColumn = ws.Cells(1, Columns.Count).End(xlToLeft).Column
src = "R1C1:R" & lastRow & "C" & lastColumn
ActiveCell.FormulaR1C1 = _
"=VLOOKUP(RC[-10],Position!" & src & ",2,FALSE)"
3 Aug 2011 à 13:41
but the variable should have been (as you correctly used) src