Autofill from a list, Print & Repeat

DragonWood

Board Regular
Joined
Oct 17, 2010
Messages
97
I have a few problems I need some help with please.
I have a spread sheet that lists all the values from a couple reports.
The idea is to have the reports automatically be filled in from the values in the list.
What I need to do is go through the list a row at a time and auto-fill the appropriate fields in the form.
The value in Column A determines which form to fill in. So if the value is “B” than it fills in one form with the values from the row.
If the value in Column A is “W” it fills in the other form.

I have a code that searches the list sheet and determines how many rows there are.
What I need to add to it is a way to make it find the row with the B and put the rest of the data from the row into the proper form. I will then direct it to a function that will print that form to a PDF.
Then the code needs to repeat and refill in the form with the next line that has a B in column A so it can be printed too.
I know I need to use a Loop, but I’m not very good at writing them.

The second part of my problem is there are randomly rows that do not have either a B or W on them, but there will be more later.

How do I modify this to skip lines that don’t have anything?
Code:
      LS = Range("A" & Rows.Count).End(xlUp).Row
Thanks.
 

Excel Facts

Can Excel fill bagel flavors?
You can teach Excel a new custom list. Type the list in cells, File, Options, Advanced, Edit Custom Lists, Import, OK

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