Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Finding matching cells | Excel Discussion (Misc queries) | |||
Finding matching cells | Excel Discussion (Misc queries) | |||
Not finding matching value in vlookup | Excel Worksheet Functions | |||
Finding matching values | Excel Worksheet Functions | |||
Finding One Value, Matching Three Criteria | Excel Discussion (Misc queries) |