Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() Hi, I want to compare 2 worksheets present in 2 different excel files. I there any way to do it? Regards, Ashis -- ashishpre ----------------------------------------------------------------------- ashishprem's Profile: http://www.excelforum.com/member.php...fo&userid=3148 View this thread: http://www.excelforum.com/showthread.php?threadid=53714 |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() What are you trying to compare? Would copying the two sheets into one 'Comparison' workbook be appropriate? The code is simpler if you're only swtiching sheets instead of books... ashishprem Wrote: Hi, I want to compare 2 worksheets present in 2 different excel files. Is there any way to do it? Regards, Ashish -- pianoman ------------------------------------------------------------------------ pianoman's Profile: http://www.excelforum.com/member.php...o&userid=33712 View this thread: http://www.excelforum.com/showthread...hreadid=537141 |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() The copying will solve the problem definitely. Actually i am getting two excel sheets daily which are needs to be compared. I am copying both the sheets in one excel file and pasting the macro in the same excel file and then i am running the macro to get the compared result. Its pretty hectic.So is there any way by which i can just give the path name for 2 files and get the compared result. -- ashishprem ------------------------------------------------------------------------ ashishprem's Profile: http://www.excelforum.com/member.php...o&userid=31485 View this thread: http://www.excelforum.com/showthread...hreadid=537141 |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
If you write the macro to operate that way, it can open the two workbooks,
create the combined workbook and then do the comparison. Your description is so vague, that it it is hard to say much beyond that. What don't you know how to do. You don't know how to open a workbook with code? Dim fName as Variant Dim fname1 as Variant Dim bk as Workbook, bk1 as Workbook Dim bk2 as Workbook, rng2 as Range fname = Application.GetOpenfileName() if fname < False then set bk = workbooks.Open(fName) end if fName1 = Application.GetOpenfileName() if fName1 < False then set bk1 = Workbooks.Open(fName1) end if if bk1 is nothing or bk2 is nothing then msgbox "Faild to designate two workbooks" exit sub end if set bk2 = Worbooks.add bk.worksheets(1).Range("A1").CurrentRegion.copy _ bk2.Worksheets(1).Range("A1") set rng2 = bk2.worksheets(1).Cells(rows.count,1).end(xlup)(2) bk1.Worksheets(1).Range("A1").CurrentRegion.copy _ rng2 bk.close Savechanges:=False bk1.Close Savechanges:=False conceptually, this should create a third workbook with data from each of the first two workbooks. -- Regards, Tom Ogilvy "ashishprem" wrote: The copying will solve the problem definitely. Actually i am getting two excel sheets daily which are needs to be compared. I am copying both the sheets in one excel file and pasting the macro in the same excel file and then i am running the macro to get the compared result. Its pretty hectic.So is there any way by which i can just give the path name for 2 files and get the compared result. -- ashishprem ------------------------------------------------------------------------ ashishprem's Profile: http://www.excelforum.com/member.php...o&userid=31485 View this thread: http://www.excelforum.com/showthread...hreadid=537141 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Accessing imported Excel files after Office 2003 SP3 upgrade | Excel Discussion (Misc queries) | |||
Accessing cells in other files | Excel Discussion (Misc queries) | |||
Trouble accessing a couple of established Excel 97 files | Excel Discussion (Misc queries) | |||
Accessing PowerPoint files from Excel | Excel Programming | |||
Accessing the values of form controls on worksheets in Excel 2000 | Excel Programming |