LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #7   Report Post  
Posted to microsoft.public.excel.programming
Jay Jay is offline
external usenet poster
 
Posts: 671
Default Rather tired and need solution please 4 Vllookup :-D

Hi Les -

Sounds like you and JMB have this under control. For what it's worth,
here's a version that's similar to JMB's. The only functional difference is
that it opens WorkbookB.xls if it's not open. If you need this capability,
run this procedure when WorkbookA is the active workbook. Otherwise,
disregard this post and have a nice evening.

Sub LesStout()
Dim wbA As Workbook
Dim wbB As Workbook
Dim wsA As Worksheet
Dim wsB As Worksheet
Dim strt As Range
Dim matching As Range

'''''''''''''''''''''''''''''''''''''''''''''''
'Modify these statements to suit
wbBPath = "C:\Documents and Settings\Les\My Documents" '<==WorkbookB path
wbBName = "WorkbookB.xls" '<==WorkbookB name
wsBName = "Sheet1" '<==Name of sheet in WorkBookB
Set strt = Range("A2") '<==Address (in WorkbookA) of first value to look for.
'''''''''''''''''''''''''''''''''''''''''''''''
Application.ScreenUpdating = False

Set wbA = ActiveWorkbook
Set wsA = wbA.ActiveSheet

On Error Resume Next
Workbooks.Open (wbBPath & "\" & wbBName)
On Error GoTo 0
Workbooks(wbBName).Activate
Set wbB = ActiveWorkbook
Set wsB = wbB.Worksheets(wsBName)

wbA.Activate
For Each itm In Range(strt, Cells(wsA.Rows.Count, 1).End(xlUp)).Cells
On Error GoTo around
Set matching = wsB.Columns(1).Find(itm, LookIn:=xlValues, lookat:=xlWhole)
itm.Offset(0, 38) = matching.Offset(0, 6).Value
around:
Next 'itm

wbB.Close savechanges:=False

End Sub
-------
Jay
 
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
I must be tired, because basic Math isn't working..... [email protected][_2_] Excel Programming 1 June 23rd 06 04:35 PM
I must be tired, because basic Math isn't working..... [email protected] Excel Worksheet Functions 0 June 22nd 06 05:30 AM
Urgent problem with Vllookup Jeff Excel Discussion (Misc queries) 2 September 22nd 05 07:05 PM
VlLOOKUP function with MATCH Amnon Wilensky Excel Worksheet Functions 2 June 6th 05 07:38 PM
Tired of Excel's Interface limitations...?? Chris Gorham[_4_] Excel Programming 1 January 9th 04 09:05 PM


All times are GMT +1. The time now is 04:30 AM.

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"