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

Show numbers in thousands?
Use a custom number format of #,##0,K. Each comma after the final 0 will divide the displayed number by another thousand
Scott

Do you really need code for this?

Wouldn't a combination of formulas suffice?

Perhaps an IF with a VLOOKUP?
 
Upvote 0
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.
 
Upvote 0
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
 
Upvote 0
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" ?
 
Upvote 0
have you tried using proper which will capitalise all the first letters, or use upper and lower
 
Upvote 0

Forum statistics

Threads
1,214,920
Messages
6,122,276
Members
449,075
Latest member
staticfluids

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