Home |
Search |
Today's Posts |
#7
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
I must be tired, because basic Math isn't working..... | Excel Programming | |||
I must be tired, because basic Math isn't working..... | Excel Worksheet Functions | |||
Urgent problem with Vllookup | Excel Discussion (Misc queries) | |||
VlLOOKUP function with MATCH | Excel Worksheet Functions | |||
Tired of Excel's Interface limitations...?? | Excel Programming |