# Microsoft Office Application Help - Excel Help forum > Non English Excel >  >  Invoice to PDF - Dropdown List selection automatically.

## Excel_Pa

Hi All,

I need a VBA code where it select customers from dropdown list one after another till the data in "Invoice Master Data" and save as PDF in particular folder.
Process:
     I will update "Invoice Master Data" sheet.
     I have create dropdown list in Cell B1 ("Invoice Format")
     "Invoice Format" F7 cell has a link from "Invoice Master Data" sheet
     Whenever I select "Invoice Format" C2 values amount will change
     VBA would choose customer's name from C2 cell one after another automatically and save as PDF in "C:\sales data\".
     in the above example
           Three invoice will generate automatically and saved in above path
Invoice_to_PDF.xlsx

Thanks

----------


## LeoTaxi

Try something like this




```
Please Login or Register  to view this content.
```


Kind regards
Leo

----------


## LeoTaxi

I think you need more in the name of PDF such as date or invoice number

----------


## Excel_Pa

Hi LeoTaxi,

I need PDF file name as "Invoice Format" C2 values (Example: 201602 FEB Customer #1, 201602 FEB Customer #2). Year and Month would pick from "Invoice Master Data" Cell A1. In future If I needed for March I will mention here.

I have noticed in the PDF file all are having same Customer #1   1 of 3, Customer #1   2 of 3 and Customer #1   3 of 3. Macro should pick all customer number with respect to their values. In the above macro it is picking up only one customer data three times. Could you remove "1 of 3" , "2 of 3", "3 of 3" after the file name.

Macro would pick up three customers data one after another from the dropdown list.

Thanks for all your help once again.

----------


## Excel_Pa

Macro would pick up three customers data one after another from the dropdown list and save as PDF.

I have taken only three customers as example. There may be cases it runs to morethan 100...

----------


## LeoTaxi

more like this




```
Please Login or Register  to view this content.
```



Kind regards
Leo

----------


## Excel_Pa

Hi Leo,

Could you write VBA for attached one more requirement for salary format.

Thanks in advance
Salary format.xlsm

----------


## LeoTaxi

Hi Excel_Pa

i made a dynamic namedrange for the names, you can see this in the name manager,
this way the validation list is always up to date.

For the formula in A31 you have to change this, you refer to column 25
and only 24 columns are available in the matrix C:Z




```
Please Login or Register  to view this content.
```




Kind regards
Leo

----------


## Excel_Pa

You are Superb!. Every time your giving me exactly the way I think. And also some suggestion and advises.  Thanks a lot for your help....

----------


## Excel_Pa

Hi Leo,

I need one more suggestion. Need modification in VBA code. In "Master Employee details" certain employee we will not issue salary slip due to they are no more working with us. So I do use "Filter" option in excel to hide their details.
For example Name 1 is not working with us. I will uncheck his name in "Filter" option. So VBA will not print his salary slip.

Thanks in advance.

----------


## LeoTaxi

Hello Excel_Pa

this will take only vissible rows




```
Please Login or Register  to view this content.
```


Kind regards
Leo

----------


## Excel_Pa

Thanks a lot Leo. Can I have your email id......

----------

