Inserting data

oldun

New Member
Joined
Sep 8, 2011
Messages
1
I have an Excel spreadsheet which contains several columns

Column A contains sequential dates as in a calendar
Column B contains the one, two or (occasionally) three names of volunteers that manned the Visitor centre that morning
Column C contains the one, two or (occasionally) three names of volunteers that manned the Visitor centre that afternoon.

There are about 50 volunteers that will appear in columns B and C, some more often than others. The names of the volunteers appear in columns B and C in different ways, such as

David Chapple
Marjorie and David Chapple
Marjorie & David Chapple
Bill Bloggs, Marjorie & David Chapple

This means that I cannot search for Marjorie Chapple, I must search separately for Marjorie and Chapple.

I have created three further columns as follows

Column D (row 6) contains the formula =IFERROR(FIND("David",C6,1),0)
Column E (row 6) contains the formula =IFERROR(FIND("Chapple",C6,1),0)
Column F (row 6) contains the formula =IF(AND(E6>0,F6>0),1,"")

Column D searches for the name David in the afternoon session for that day and returns 0 if not found and a number>0 if it is.

Column E searches for the name Chapple in the afternoon session and returns 0 if not found and a number>0 if it is.

Column F returns a 1 if both David and Chapple are found for that afternoon session and remains blank if the both names are not found.

I can now write a further three columns to find when David Chapple manned the centre in the morning.

So I now know how many sessions (morning or afternoon) that David Chapple manned the centre.

Now I can create a macro that will do the whole process for me.

My problem is this - I have to repeat the process for all 50 volunteers and the only way I know of doing this is to manually change the names in the macro for each of the volunteers.

As all the names of the volunteers are contained in a separate Excel table (one column for first name and another for the family name) I would like to know how I can automatically import the names into to my macro so that it can find out the necessary information for all 50 volunteers?
 

Excel Facts

Difference between two dates
Secret function! Use =DATEDIF(A2,B2,"Y")&" years"&=DATEDIF(A2,B2,"YM")&" months"&=DATEDIF(A2,B2,"MD")&" days"

Forum statistics

Threads
1,224,599
Messages
6,179,831
Members
452,946
Latest member
JoseDavid

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