LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 16
Default using a vlookup command in a for next loop in a macro in excel

Can anyone help me with the correct syntax for this?
I'm using Office 2003......

Here is my problem:

Ok, I start with a string of text and fill in columns using a €ś=mid€ť
formula€¦

finalrow = Cells(65536, 1).End(xlUp).Row
For i = 1 To finalrow
MyText = Cells(i, 1)

Cells(i, 2).Value = Mid(MyText, 18, 3)
x = Mid(MyText, 18, 3).value
Cells(i, 3).Value = Mid(MyText, 10, 2)


So I now have my value for columns 2 and 3€¦ and I have the variable x set
to the value of column 2.

Now I want to use a €śvlookup€ť command to search another worksheet for the
value of column 4.
(call the other worksheet, €śsecond€ť and the value looking up is in sheet 1,
column €śa€ť, returning the value in column €śc€ť)

So if the value of column 4 equals €śy€ť then

Cells(I, 4).Value = y

Next i

Thanks in Advance for all your help.....

 
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
loop a macro jnjwilliams94 Excel Discussion (Misc queries) 4 August 26th 06 01:52 PM
how to put a loop in a macro? Khoshravan New Users to Excel 4 May 14th 06 01:22 PM
How can I setup an Excel Macro to loop? ExcelNovice Excel Discussion (Misc queries) 3 March 28th 06 10:12 PM
Excel Macro loop problems mibsaweiss Excel Discussion (Misc queries) 0 March 16th 06 04:45 PM
VLOOKUP loop multiple times Lenny Excel Worksheet Functions 3 September 28th 05 10:31 AM


All times are GMT +1. The time now is 08:09 PM.

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

About Us

"It's about Microsoft Excel"