ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   vlookup (https://www.excelbanter.com/excel-worksheet-functions/6107-vlookup.html)

lost!!

vlookup
 
hello,

trying to do the following
for i = 1 to 3
b=1
.....bunch of other actions
=vlookup(##,table,2,0)
b=b+1
next i

how do I get the formula to use B as the cell reference?
my table has this

1 red
2 blue
3 green

I want a different colour to be used each time excel goes through the loop.

Hope you can help!!!

thanks in advance!



N Harkawat

Application.WorksheetFunction.VLookup(....

"lost!!" wrote in message
...
hello,

trying to do the following
for i = 1 to 3
b=1
....bunch of other actions
=vlookup(##,table,2,0)
b=b+1
next i

how do I get the formula to use B as the cell reference?
my table has this

1 red
2 blue
3 green

I want a different colour to be used each time excel goes through the

loop.

Hope you can help!!!

thanks in advance!





lost!!

I get a compile error. Here's how i've typed it in:

Application.WorksheetFunction.vlookup(b,table,2,0)

I have also tried:
Application.WorksheetFunction.vlookup((b),table,2, 0)

Any suggestions?
"N Harkawat" wrote:

Application.WorksheetFunction.VLookup(....

"lost!!" wrote in message
...
hello,

trying to do the following
for i = 1 to 3
b=1
....bunch of other actions
=vlookup(##,table,2,0)
b=b+1
next i

how do I get the formula to use B as the cell reference?
my table has this

1 red
2 blue
3 green

I want a different colour to be used each time excel goes through the

loop.

Hope you can help!!!

thanks in advance!






N Harkawat

temp = Application.WorksheetFunction.vlookup(b,table,2,0)

"lost!!" wrote in message
...
I get a compile error. Here's how i've typed it in:

Application.WorksheetFunction.vlookup(b,table,2,0)

I have also tried:
Application.WorksheetFunction.vlookup((b),table,2, 0)

Any suggestions?
"N Harkawat" wrote:

Application.WorksheetFunction.VLookup(....

"lost!!" wrote in message
...
hello,

trying to do the following
for i = 1 to 3
b=1
....bunch of other actions
=vlookup(##,table,2,0)
b=b+1
next i

how do I get the formula to use B as the cell reference?
my table has this

1 red
2 blue
3 green

I want a different colour to be used each time excel goes through the

loop.

Hope you can help!!!

thanks in advance!








lost!!

I'm sorry - not sure if I'm just missing it but it's not taking it.

In case it helps, here's my module exactly:

Dim a, b As Integer
a = 6
b = 0
For i = 1 To 3
a = a + 2
b = b + 1
Do While ActiveCell.Offset(1, 0) < ""
ActiveCell.Offset(1, 0).Select
Sheets("sheet3").Select
ActiveCell.FormulaR1C1 = "HOM"
ActiveCell.Offset(0, 1).Select
temp = Application.WorksheetFunction.VLookup(b, incrcov, 2, 0)
ActiveCell.Offset(0, 2).Select
Loop
Next i


"N Harkawat" wrote:

temp = Application.WorksheetFunction.vlookup(b,table,2,0)

"lost!!" wrote in message
...
I get a compile error. Here's how i've typed it in:

Application.WorksheetFunction.vlookup(b,table,2,0)

I have also tried:
Application.WorksheetFunction.vlookup((b),table,2, 0)

Any suggestions?
"N Harkawat" wrote:

Application.WorksheetFunction.VLookup(....

"lost!!" wrote in message
...
hello,

trying to do the following
for i = 1 to 3
b=1
....bunch of other actions
=vlookup(##,table,2,0)
b=b+1
next i

how do I get the formula to use B as the cell reference?
my table has this

1 red
2 blue
3 green

I want a different colour to be used each time excel goes through the
loop.

Hope you can help!!!

thanks in advance!










All times are GMT +1. The time now is 08:37 AM.

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