I have 2 workbooks A & B.The workbooks are already defined.
I have an issue with part of my code where I am trying to compare column A from workbook A and Column D from Workbook B. If it matches then I want to copy corresponding column B to Workbook column E.
I started to write the following code but not sure how to proceed further in comparing the columns and copying as I am fairly new to VBA. I am not trying to match row by row, I am checking the entire column.
Dim strRangeToCheckA As Range
Dim strRangeToCheckB As Range
Dim strRangeToCheckC As Variant
Set strRangeToCheckA = RSC.Sheets("Balance").Range("A:G")
Set strRangeToCheckB = Brostacc.Sheets("Stock").Range("A:U")
Set strRangeToCheckC = Brostacc.Sheets("Stock").Range("U:U")
If Application.VLookup(LookFor, strRangeToCheckA, 2, False) = Application.VLookup(LookFor, strRangeToCheckB, 1, False) Then
strRangeToCheckC = Application.VLookup(LookFor, strRangeToCheckA, 7, False)
End If
I appreciate the help and Thanks in Advance!
Our community of experts have been thoroughly vetted for their expertise and industry experience.
The Most Valuable Expert award recognizes technology experts who passionately share their knowledge with the community, demonstrate the core values of this platform, and go the extra mile in all aspects of their contributions. This award is based off of nominations by EE users and experts. Multiple MVEs may be awarded each year.
The Distinguished Expert awards are presented to the top veteran and rookie experts to earn the most points in the top 50 topics.