LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 30
Default Help on Vlookup for Undetermined Range

Am new on macros and need assistance to adjust the macro below for
undetermined ranges

Dim rng As Range
Dim i As Integer

With Worksheets("sheet1")
Set rng = .Range("a2:b8")
End With

For i = 1 To 7
With Worksheets("sheet2") 'assuming the data you want goes to column b
and
'the lookup value is in Column A'
..Cells(1 + i, 2) = Application.WorksheetFunction.VLookup(.Cells(1 + i,
1), rng, 2, 1)
End With

Next i

 
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 more than 2 range hitesh Excel Discussion (Misc queries) 5 May 30th 08 09:30 PM
Using VLOOKUP with a 3D range Cassie Excel Worksheet Functions 4 September 11th 07 11:29 PM
Summing values from an undetermined number of sheet smaruzzi Excel Worksheet Functions 3 April 6th 07 08:16 PM
Vlookup where range changes Greg Excel Worksheet Functions 1 March 17th 06 11:41 PM
Summing undetermined colums RJH Excel Programming 7 December 23rd 03 07:01 PM


All times are GMT +1. The time now is 05:51 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"