Hello again,
I am struggling with some huge file where i have to make some vlookup.
Basically there are 2 sheets with data. Around 200-300k rows each. Sometimes maybe even more.
One sheet is called Auto and the other is called Manual.
I need to compare both sheets and problem is that columns and rows are not in same order.
So what i did is copy one column that is with unique values that will help make it as the vlookup anchor (Column L from Auto sheet) and paste it in Check sheet (in column A).
And then have 24 columns to compare, so the code above will be repeated 23 times more.
First one being pasted in column B, then the vlookup will happen in column C and the check will be performed in column C.
Next column to check will be pasted in D... and so on... So each check consists of 3 columns, times 24.. you can imagine the mess with vlookup and so many rows.
I'm not very friendly with loops and similar but i'm sure this could easily be able to be coded with a loop.
My initial problem at moment is that the Vlookup formula line i have takes forever, since there are many rows and calculating everything at the same time, I'd be grateful to know some other way to make the vlookup, probably with another look checking one cell by one..
At the end the best would also be that copies whole column and paste it as values and then moves to the next column and do same process again..
Not sure if it makes sense 100%...
I'm open for feedback and looking forward to hear about some ideas in how to improve and make better what i did.
Thanks in advance.
I am struggling with some huge file where i have to make some vlookup.
Code:
'Position Key
Sheets("Auto").Range("L1:L" & LastRowAuto).Copy Destination:=Sheets("Check").Range("A1")
LastRow = Range("A1").End(xlDown).Row
'Column1
Sheets("Auto").Range("Q1:Q" & LastRowAuto).Copy Destination:=Sheets("Check").Range("B1")
Range("C2:C" & LastRow) = "=VLOOKUP(A2,'Manual'!M:BQ,16,FALSE)"
Range("D2:D" & LastRow).FormulaR1C1 = "=RC[-1]=RC[-2]"
Basically there are 2 sheets with data. Around 200-300k rows each. Sometimes maybe even more.
One sheet is called Auto and the other is called Manual.
I need to compare both sheets and problem is that columns and rows are not in same order.
So what i did is copy one column that is with unique values that will help make it as the vlookup anchor (Column L from Auto sheet) and paste it in Check sheet (in column A).
And then have 24 columns to compare, so the code above will be repeated 23 times more.
First one being pasted in column B, then the vlookup will happen in column C and the check will be performed in column C.
Next column to check will be pasted in D... and so on... So each check consists of 3 columns, times 24.. you can imagine the mess with vlookup and so many rows.
I'm not very friendly with loops and similar but i'm sure this could easily be able to be coded with a loop.
My initial problem at moment is that the Vlookup formula line i have takes forever, since there are many rows and calculating everything at the same time, I'd be grateful to know some other way to make the vlookup, probably with another look checking one cell by one..
At the end the best would also be that copies whole column and paste it as values and then moves to the next column and do same process again..
Not sure if it makes sense 100%...
I'm open for feedback and looking forward to hear about some ideas in how to improve and make better what i did.
Thanks in advance.