Get help Macro sheet

- - Latest reply: ac3mark
Posts
13031
Registration date
Monday June 3, 2013
Status
Moderator
Last seen
September 20, 2019
- Aug 23, 2019 at 04:46 PM
Hello,

My name is vivekanandan i am try to create macro sheet like compare two different excel file and get the output in new excel file but i am not getting CMD or coding for it can any one help me in it
See more 

1 reply

Posts
13031
Registration date
Monday June 3, 2013
Status
Moderator
Last seen
September 20, 2019
1402
0
Thank you
You can't find code to even start? I went straight to Microsoft,and found this example:

Sub ImportWorksheet()
' This macro will import a file into this workbook
Sheets("Sheet1").Select
PathName = Range("D3").Value 'example - c:\
Filename = Range("D4").Value 'example - Book1.xlsx
TabName = Range("D5").Value 'example -BookONE
ControlFile = ActiveWorkbook.Name
Workbooks.Open Filename:=PathName & Filename
ActiveSheet.Name = TabName
Sheets(TabName).Copy After:=Workbooks(ControlFile).Sheets(1)
Windows(Filename).Activate
ActiveWorkbook.Close SaveChanges:=False
Windows(ControlFile).Activate
End Sub


It will load any spreadsheet you want, and combine it into your current workbook. So, when you are ready to compare, and you realize that line 1 on sheet1 is line 10 on sheet2, but it was output to your third sheet anyway (not wanting it, because it was found on each sheet), you will realize what kind of processing power you are going to need, depending on your file sizes.

You do understand that in the above example, in order to do a comparison, we would need to load every value for comparison. If it is a line by line comparison, then no big deal, and you would expect to get row 1 back on your third sheet, as row 1 an sheet 1 would not match row 1 of sheet2!


Now, we have not got to the comparison part, because it is important to know what kind of comparison you want. Do you want anything found on sheet1, and not on sheet2 to be placed? Does row X on sheet1 have to match row X on sheet2?

So what is this comparison for?

Respond to ac3mark