#1   Report Post  
lost!!
 
Posts: n/a
Default 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!


  #2   Report Post  
N Harkawat
 
Posts: n/a
Default

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!




  #3   Report Post  
lost!!
 
Posts: n/a
Default

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!





  #4   Report Post  
N Harkawat
 
Posts: n/a
Default

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!







  #5   Report Post  
lost!!
 
Posts: n/a
Default

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!








Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Vlookup finds a blank, but returns a zero - HELP! flummoxed Excel Discussion (Misc queries) 6 January 18th 05 04:15 PM
Vlookup Syntax Error YV New Users to Excel 9 December 23rd 04 06:28 PM
Need help with modifying VLookUp Tom Excel Discussion (Misc queries) 4 December 2nd 04 01:44 AM
Using Cell references in VLookUp JonWilson631 Excel Worksheet Functions 1 November 4th 04 03:49 AM
vlookup. Amit Excel Worksheet Functions 2 November 3rd 04 01:34 PM


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

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"