VBA code to loop through 2 worksheets and find the matching Column title

Nite0wls

New Member
Joined
May 21, 2014
Messages
33
Office Version
  1. 2019
  2. 2013
Platform
  1. Windows
Dear Experts,

As newbie I am seeking your help in resolving my challenge for the below task.

I have two tabs in Excel 2010 version.

Tab 1 = "Tel Nr table"
Tab 2 = "IVR Table"

Tel Nr Table
NoteIP ROWDNISCountryLanguagesSiteIVRTEST
8485600:oops:Australiaen-AUAPACAPAC Main APAC Main
8495601:oops:Australiaen-AUAPACAPAC Main APAC Main
8505602Australiaen-AUAPAC APAC MR Direct Dial
8515603Australiaen-AUAPACAPAC Main APAC Main
8525604Australiaen-AUAPACAPAC Main APAC Main
8535605Australiaen-AUAPACAPAC Main APAC Main

<tbody>
</tbody>

IVR Table
APAC DRAPAC DR Direct DialAPAC DR TransferAPAC MainAPAC MRAPAC MR Direct Dial
6100122026100025600:oops:610013203
5601:oops:57641202
560357641211
560457641218
560557641241
56075602
56105608
56115613
56145627
56155630
56165635
56175641
56185646
56205657
562157641245

<tbody>
</tbody>

The task at hand is to extract the title name from each the column on the IVR Table worksheet to the Test column on the Tel nr Table when the numbers on the both worksheets are matching. In each worksheet the number is unique, however not all numbers are nessecarely in the IVR table.

Background is that the IVR Table data is extracted from a system, while the values in the IVR column in the Tel nr Table was manualy added. The IVR has been changed many times and the manual values haven't been updated and I need to know which are out of sync and to correct those that are incorrect.

The IVR Table has 150 different column names across with underneeth the corresponding numbers to these names.
The numbers under the columns can go up to 600 numbers deep, might extend (more then 150 titles and 600 nrs) or shrink (less than 150 titles and 600 nrs)

Hence what I try is to match each number column C (DNIS) from the Tel Nr Table with the corresponding number in the IVR Table, once found go to the top column and take the column label and put that label in the Tel Nr Table Test (column H) for the row I found the Tel Nr on. Since I don't know what nr matches with what IVR Column it is a bit complicated. It also might be that another IVR is added or one is removed, for which I have to transfer the numbers, so I might need to compare in future again.
 
Last edited:

Excel Facts

Using Function Arguments with nested formulas
If writing INDEX in Func. Arguments, type MATCH(. Use the mouse to click inside MATCH in the formula bar. Dialog switches to MATCH.

Forum statistics

Threads
1,215,006
Messages
6,122,666
Members
449,091
Latest member
peppernaut

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top