ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Error in Vlookup formula (https://www.excelbanter.com/excel-programming/412115-error-vlookup-formula.html)

Fred

Error in Vlookup formula
 
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

Don Guillett

Error in Vlookup formula
 
try
ActiveCell.Formula = "=vlookup(C" & rw & ",ShopNames!A3:B100,2)"


--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"Fred" wrote in message
...
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



Niek Otten

Error in Vlookup formula
 
Hi Fred,

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

--
Kind regards,

Niek Otten
Microsoft MVP - Excel



"Fred" wrote in message ...
| 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



Fred

Error in Vlookup formula
 
Thanks Don.
I had tried the quotes, but forgot about the second ampersand. Work great
now!
Fred

"Don Guillett" wrote:

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


--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"Fred" wrote in message
...
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




Dave Peterson

Error in Vlookup formula
 
Maybe...

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

Fred wrote:

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


--

Dave Peterson

Don Guillett

Error in Vlookup formula
 
glad to help

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"Fred" wrote in message
...
Thanks Don.
I had tried the quotes, but forgot about the second ampersand. Work great
now!
Fred

"Don Guillett" wrote:

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


--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"Fred" wrote in message
...
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






All times are GMT +1. The time now is 02:21 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com