Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8
Default Finding a matching value in another file

Hi

I have two .xls files, Learnmacs (lm) and Convoluted (cd) (some of you may
recognize these from earlier questions).

lm has 12 dates above which is a reference for these 12 dates. I have code
that finds the highest of these twelve dates and assigns that date to a
variable. Now all I want to do is open the second file - cd - search a range
of cells (A10:A20) for the reference, select the cell with the reference,
offset by 2 and paste the highest date. Here is the code I have so far (with
help from this Discussion group).

Private Sub CommandButton3_Click()

Dim ref As Range, gethighest As Range
Set ref = Worksheets("Sheet1").Range("A19")
Set gethighest = Worksheets("Sheet1").Range("A20:C23")
highest = Application.WorksheetFunction.Max(gethighest)
Workbooks.Open ("C:\Documents and Settings\Andrew\My Documents\Serious
Stuff\TCSpreadsheets\Convoluted.xls")
cd = ActiveWorkbook.Name
Dim cdrefcol As Range
Set cdrefcol = Range("A10:A20")

ref is the variable holding the reference to search for
highest is the variable holding the highest date
cdrefcol is the range to search in cd for the reference (ref)


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
Finding matching cells GARY Excel Discussion (Misc queries) 1 March 6th 09 07:40 AM
Finding matching cells GARY Excel Discussion (Misc queries) 1 March 6th 09 06:28 AM
Not finding matching value in vlookup JBS Excel Worksheet Functions 2 April 1st 08 08:13 PM
Finding matching values whiteviper Excel Worksheet Functions 0 January 28th 08 02:22 PM
Finding One Value, Matching Three Criteria cattle mgr Excel Discussion (Misc queries) 2 August 29th 05 08:32 PM


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