Error in Vlookup formula

  • Thread starter Thread starter Fred
  • Start date Start date
F

Fred

Hi
I'm not sure where my error is in this code. In other formulas, this works.

Dim RW As Integer
RW=1
ActiveCell.Formula = "=vlookup(C & rw,ShopNames!A3:B100,2)"

The "C" is referring to the C column and the "& rw" is referring to row RW,
what ever the row # happens to be.

What am I missing?

Thanks
Fred
 
try
ActiveCell.Formula = "=vlookup(C" & rw & ",ShopNames!A3:B100,2)"
 
Hi Fred,

ActiveCell.Formula = "=vlookup(" & c & rw & ",ShopNames!A3:B100,2)"

--
Kind regards,

Niek Otten
Microsoft MVP - Excel



| Hi
| I'm not sure where my error is in this code. In other formulas, this works.
|
| Dim RW As Integer
| RW=1
| ActiveCell.Formula = "=vlookup(C & rw,ShopNames!A3:B100,2)"
|
| The "C" is referring to the C column and the "& rw" is referring to row RW,
| what ever the row # happens to be.
|
| What am I missing?
|
| Thanks
| Fred
 
Thanks Don.
I had tried the quotes, but forgot about the second ampersand. Work great
now!
Fred
 
Maybe...

ActiveCell.Formula = "=vlookup(C" & rw & ",ShopNames!A3:B100,2)"
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

User inserted value 4
UserForm QueryClose 2
Drawing a line for a set range 1
BeforeDoubleClick Event not working 2
Copy range if match 2
Move and Link3 1
Fails to delete empty rows 4
Vlookup help, please 5

Back
Top