print file if value exist

erwindebruin

New Member
Joined
Oct 25, 2005
Messages
3
Hello,

I've a question: I like to have an excel sheet with in column a an activity and in column b a name of an person. Example:

activity1 name1
activity2 name2
activity3 name3
activity1 name4

Now i like to run a macro which:

*print document1 if value in column A is activity1 with the name listed in column B copied in document1 cell A1

*print document2 if value in column A is activity2 with the name listed in column B copied in document1 cell A1

*print document3 if value in column A is activity2 with the name listed in column B copied in document1 cell A1

Etcetera...

There are:
* 10 different activities with 10 different documents
* variabel number of names
* number of rows (in the excel sheet with the activities and the names)

How can I make this working ok?

Thanx in advance.

Erwin
 

Excel Facts

Difference between two dates
Secret function! Use =DATEDIF(A2,B2,"Y")&" years"&=DATEDIF(A2,B2,"YM")&" months"&=DATEDIF(A2,B2,"MD")&" days"
Do you mean this instead?

*print document1 if value in column A is activity1 with the name listed in column B copied in document1 cell A1

*print document2 if value in column A is activity2 with the name listed in column B copied in document2 cell A1

*print document3 if value in column A is activity2 with the name listed in column B copied in document3 cell A1

When you say document, i suppose you mean a workbook right? or is it another worksheet in the same workbooK? or is it an actual separate word document?
 
Upvote 0
I can think of two ways of doing it right now.

1. add another column, that column would be the file path of the document.

You would have to write code to open the workbook and put the name in it and print it.

2. add all the individual documents as worksheets into the main workbook.
That way you can just refer to specific sheet without having to write code to open workbooks.

If you need help writing the code, let me know.
 
Upvote 0

Forum statistics

Threads
1,214,644
Messages
6,120,709
Members
448,983
Latest member
Joaquim_Baptista

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