request for VBA to find information in various cells

MAP

Active Member
Joined
Mar 22, 2007
Messages
312
Office Version
  1. 2007
Platform
  1. Windows
I have a personal project that requires obtaining information from multiple cells in a worksheet and transferring that various information to other worksheets. I have no knowledge of macro, but I know what I need to have done must be be done with a macro.. I seek the help of the Excel gurus to offer me with a code (and hopefully explain how it works). I AM HOPING THE EXPERTS WILL HELP ME WITH THIS CHALLENGE.

Since there is no guarantee the information in a particular row for every instance, I need Excel to look for a string in Column A and then find the contents of the cell beneath (or adjacent to) that string.. and then make a list of that information on a different worksheet.

The information will be manually copied/pasted onto SHEET1 by me before I run the macro.. most of the relevant data will be in Column A and B

1) When the macro is run in SHEET1, I want Excel to look along columns A:B and find the Employee#, the Last name, the First name, the gender, and the date of birth and copy that data on a separate sheet (called LIST1). The next time the macro is run, Excel should copy the new information below the previous entry. Also, it would be good to have Excel notice the MALE or FEMALE in SHEET1 and convert that to "Mr." or "Ms."

2)When the macro is run in SHEET1, I also want Excel to form a similar list on worksheet LIST2. In this worksheet, I need Excel to concatenate the three names of the employee and enter it in one cell; and enter the employee# and the adjacent cell. Similar to LIST1, Excel should copy the new data below the previous entry.

3)In the worksheet FORM1, I want Excel to copy certain information from SHEET1 all concatenated in one cell. I intend to use this to print the address on envelopes. So in FORM1 in one particular cell, Excel should copy the three names; drop down a line; copy STREET1 and STREET2 with a space in between; drop a line; copy the CITY, STATE, and ZIP (with the necessary spaces and comma) or the "Primary Address". When the macro is run again, Excel should simply write the new information over the previous in that same cell.

4) In worksheet FORM2, the function will be similar to FORM1 except that on this worksheet, Excel uses the information found under "Mailing Address" in SHEET1

ABCDEFGH
1
Employee#
12345678SmithJohnMr.01/02/1982
2
12345678
3John Doe Smith12345678
4
Basic Information

5
FIRST NAME
John
Mr. John Doe Smith
6
MIDDLE NAME
Doe
123 Any Street
7
LAST NAME
Smith
Apt #111
8
SUFFIX
Jr
Houston, TX 77001
15
DOB
01/02/1982
18
SEX
Male
Mr. John Doe Smith
20
Physical Address

456 This Lane
21Street1
123 Any Street
-
22
Street2
Apt #111
Dallas, TX 77007
23
City
Houston
24
State
TX
25
Zip
77001
30
Mailing Address

31
Street1
456 This Lane
32
Street2

33
City
Dallas
34
State
TX
35
ZIP
77007

<tbody>
</tbody>
 

Excel Facts

Test for Multiple Conditions in IF?
Use AND(test, test, test, test) or OR(test, test, test, ...) as the logical_test argument of IF.
Sorry, I forgot yo mention: besides being a novice with Excel... I am still using EXCEL 2003..
 
Upvote 0
I will truly appreciate the help of the excel gurus...
 
Upvote 0
Bump?? I am patiently waiting for someone experienced with macros that can help me with this task
 
Upvote 0
Hi MAP, per your request by private message, I have read you description of what you would like to do with the data in sheet 1 and have concluded that it is beyond my expertise to attempt to get the results that you want. Your data base appears to be excedingly random with key data entries and I am not aware of a method, other than use of input boxes which require user participation to seek out data and attempt to organize it onto another sheet. Computers are extremely dumb. They cannot think. But given appropriate logical instructions, they can execute those instructions very quickly, causing some people to think the computer is smart. It is not. If your data base is laid out in an organized format, so that types of data are in columns or rows, rather than randomly dispersed throughout the worksheet, then VBA can sort through it and produce valid output. But the illustration in this post does not indicate that the data is sufficiently organized to successfully produce what you want.
 
Upvote 0

Forum statistics

Threads
1,215,040
Messages
6,122,806
Members
449,095
Latest member
m_smith_solihull

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