Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 226
Default Macro for Match Value in another workbook

Hello All,

Im trying to modify a macro I've used in the past for another routine, but
Im not having much luck and could use a little advice.

Im basically looking to perform a Match and Copy.Cell.Offset.Value to
another workbook. The first ActiveWorkbook is referenced as Oldbook. The
Oldbook Row 5 is the column Im looking to match against Workbook 2
(FileName) Row 1 contents. I would like the Macro to evaluate/match each
individual cell value in rows 1 through 200 (Oldbook). If there is a Match
in the FileName book, Id like to write Oldbook values for Row 7, 8, 10 to
rows 2, 3 and 4 in FileName book for that particular match (and continue down
the worksheet).

I know this request might be a bit confusing, but Im hoping this along with
the Macro might shed additional light on the basics of my request.

Thanks for your review and thoughts €“ Roger


Sub fyCompare()
Dim Msg As String
Dim Path As String
Dim FileName1 As String
Dim FileName2 As String

On Error Resume Next
Application.ScreenUpdating = False
Msg = "Unable to find"
Path = "C:\Documents and Settings\Roger\Desktop\"
Filename = "Events.xls"

Oldbook = ActiveWorkbook.Name
Err = 0

If WorkbookIsOpen(Filename) = False Then
Workbooks.Open Filename:=Path & Filename
Else
Workbooks(Filename).Activate
End If
If Err < 0 Then
MsgBox Msg & Path & Filename, vbCritical, "Error"
Exit Sub
End If

Workbooks(Filename).Activate

For r = 1 To 200

'<<<<<< need macro that steps down and
'evaluates each match and writes to offset cells


End If
Next r

Workbooks(Filename).Close
Application.ScreenUpdating = True
End Sub
Private Function WorkbookIsOpen(wbName) As Boolean
' Returns TRUE if the workbook is open
Dim X As Workbook
On Error Resume Next
Set X = Workbooks(wbName)
If Err = 0 Then WorkbookIsOpen = True _
Else: WorkbookIsOpen = False
On Error GoTo 0
End Function





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
Workbook name in VBA doesn't match filename.xls JoeAdidas21 Excel Discussion (Misc queries) 5 November 16th 07 03:37 PM
match and insert from one workbook to another maijiuli Excel Worksheet Functions 4 October 16th 07 11:16 PM
Trying to match certain fields from 1 workbook to another AngelaD Excel Discussion (Misc queries) 0 January 15th 07 08:02 PM
Runing a macro in a workbook from another macro in other workbook dhatul Excel Discussion (Misc queries) 0 January 13th 06 06:27 AM
Index/Match to look up a value in one workbook and insert it into. Jean Marie Excel Discussion (Misc queries) 2 February 22nd 05 01:53 PM


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