Hello all,
I need a help...!! I need help to write macro to compare two sheets, sheet1 and sheet2 on same excel book and display the result on the third sheet. The number of rows and columns may not be equal and it can vary each time.
So we need to find the range of columns and rows first..! I am struggling with this. So please extend your helping hands........
I tried the following code to compare the values,
Sub Macro7()
'
' Macro7 Macro
' Macro recorded 12/11/2008 by UBOC User
'
'
Range("A2").Select
ActiveCell.FormulaR1C1 = _
"=IF(SIT!RC=PPE!RC,"" "",CONCATENATE(SIT!RC,"" - "",PPE!RC))"
Range("A2").Select
Selection.AutoFill Destination:=Range("A2:EG2"), Type:=xlFillDefault
Range("A2:EG2").Select
Selection.AutoFill Destination:=Range("A2:EG1614"), Type:=xlFillDefault
Range("A2:EG1614").Select
End Sub
But here I don't know how to get the Range dynamically and implement it in this macro....
Some one Please help......
Also in addition to to finding the number of Rows and Columns in the above way, if you are using the code you provided in the first place the syntax for autofill is as follows -
|