Multiple printing - rather a complex macro? :/

beebo2

New Member
Joined
Aug 3, 2018
Messages
3
Hello!
I've run into difficulties with coming up with a macro. I'm really just a begginer, but I hope someone could help O:)
What I need would be a macro that could print multiple times. The idea is, that on a sheet I would have a list of - let's say - codes of products which I would manually add there. The macro, then, would take each one of them and copy it into a sheet, but it would depend on the product code which sheet to paste it in. Then it would print them all.
If you could help me with at least a brief structure (I imagine there would be the PrintOut command which would be iterated and then some "If-Then"s), I'd be so much thankful!
Thank you so much in advance.
 

Excel Facts

Using Function Arguments with nested formulas
If writing INDEX in Func. Arguments, type MATCH(. Use the mouse to click inside MATCH in the formula bar. Dialog switches to MATCH.
Hi. 'Copy into a sheet but that would depend on the product code' is too vague to be able to help with that but heres a basic code that loops through each cell in a range

Code:
With Sheets("Codes")
    lr = .Range("A" & .Rows.Count).End(xlUp).Row
    For Each c In .Range("A1:A" & lr)
        '***more code
    Next
End With
 
Upvote 0
Hi. 'Copy into a sheet but that would depend on the product code' is too vague to be able to help with that but heres a basic code that loops through each cell in a range

Oh okay, thank you so much. I tried to create an algoritm which could at least a bit represent what I mean by that.
I have multiple list with products, so I need to check if that product is from one of them and according to that I would need to paste the product code into a different list and print that list. Sorry that I didn't specify it like that in the first place.

algoritm.png
 
Upvote 0
Whilst i can understand i think you still dont say what is list A or what is list B. You dont say where the list of codes to search is found. You dont say if you are making new lists or overtyping your codes in the Sheets a and b? Macros are generally very specific following repeatable rules.
 
Upvote 0
Okay, sorry, so there are multiple sheets containing product numbers and their specified data, which are not important for now. Let's say these are called "Sheet A" and "Sheet B". I'd have another sheet where I would write in the specific product codes I want to print, let's say into a sheet called "Print", specifically probably into the A column. I'd need to check if the product code from the "Print" sheet is either from "Sheet A" column A, or "Sheet B" column A, as they are listed there. Then the product code should be copied and pasted into a cell in another sheet, because there is the actual "product datasheet" I need to print out. But the products from "Sheet A" have a different datasheet than the "Sheet B" products, so according to that, the macro would need to decide if it pastes and prints the "Datasheet A" sheet (if the product code matches one of the product codes in "Sheet A") or "Datasheet B". I hope it's not too confusing. Thank you so much for your patience.
 
Upvote 0

Forum statistics

Threads
1,224,822
Messages
6,181,165
Members
453,021
Latest member
Justyna P

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