Task, & I haven't touched VBA for 1 year

ScottNiag

Active Member
Joined
Sep 3, 2002
Messages
260
I haven't done a thing in VBA for over a year, and now have to quickly come up with a solution to the following problem.

I have a bunch of data - names, addresses, etc, some with telephone numbers, some without. This is in 13 columns. After leaving a space, I have another bunch of data, which contains all the same names. Everything in this data is in uppercase. All these names have telephone numbers. There are more names in the first bunch than the second. Every name in the first bunch which ISN"T in the second bunch does have a telphone number.

Problem: I need to go down the first bunch of data, and, when I find a name with no tel number, then proceed to look up the information in the uppercase bunch of data to the right.

I think I could figure this out in 5 or 6 hours, but was wondering if anyone could give me a bit of quick code to speed things up. Any help appreciated.
 

Excel Facts

Can you sort left to right?
To sort left-to-right, use the Sort dialog box. Click Options. Choose "Sort left to right"

Norie

Well-known Member
Joined
Apr 28, 2004
Messages
76,300
Office Version
  1. 365
Platform
  1. Windows
Scott

Do you really need code for this?

Wouldn't a combination of formulas suffice?

Perhaps an IF with a VLOOKUP?
 

ScottNiag

Active Member
Joined
Sep 3, 2002
Messages
260
I don't know. there are over 4,000 rows of data, and there are in many cases more than one name with the same initals and last name, so I was planning to make sure that both the first name, last name, and street address all matched before plucking the phone number.
 

Dufus

Board Regular
Joined
Aug 19, 2006
Messages
176
ScottNiag,

If every person in the first bunch without a telephone number is listed in the second bunch with a telephone number, all you need is:

=vlookup(A3, O$3:O$999, 2, False) (in cell N3 and copied down)
assuming the telephone number in the first bunch is in column A and the names in the second bunch begin in column O and the phone numbers in the second bunch are in column P.

Dufus
 

ScottNiag

Active Member
Joined
Sep 3, 2002
Messages
260

ADVERTISEMENT

I have found that I can't try to match addresses because, although they appear identical, one has a bunch of spaces at the end.How can I take a cell with this: : "123 HArvest Lane " an dconvert it to "123 Harvest lane" ?
 

shippey121

Well-known Member
Joined
Mar 21, 2006
Messages
1,001
have you tried using proper which will capitalise all the first letters, or use upper and lower
 

Forum statistics

Threads
1,136,309
Messages
5,674,998
Members
419,541
Latest member
freddyboots

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
Top