Multiple prints

lapta301

Well-known Member
Joined
Nov 12, 2004
Messages
1,001
Office Version
  1. 365
Platform
  1. Windows
I have a Data Validation list in C3 which at present has the acceptable values of 0, 16 & 24 although these could change.

What I would like is a macro that would go through and select each of the acceptable values and then print the page.

Each value changes the calculations on the page.

As ever your help is most appreciated.
 

Excel Facts

Why are there 1,048,576 rows in Excel?
The Excel team increased the size of the grid in 2007. There are 2^20 rows and 2^14 columns for a total of 17 billion cells.
Hi
Yes they are in the validation as a comma separated list as there shouldn’t be too many of them no more than 5 I think.
 
Upvote 0
Try this

VBA Code:
Sub MultiplePrints()
  Dim c As Variant
  With Range("C3")
    For Each c In Split(.Validation.Formula1, ",")
      .Value = c
      ActiveSheet.PrintOut
    Next
  End With
End Sub
 
Upvote 0
Hi DanteAmor
Thank you so much. I will not be able to test it out for a few days but I will let you know how it goes.
Again my sincere thanks for taking an interest in my problem.
 
Upvote 0
Hi
Just ran the code and I get Run time error 1004 Application defined or object defined error.
Not sure if code should be in module, sheet or workbook so tried all three.
Just to recap at the moment there are 3 values in the dropdown so the code needs to change the value from one to the next, print the sheet then move onto the next value.
Would it be easier to have the values in a cell location rather than in the validation itself?

Thanks
 
Upvote 0
I think that it breaks down at the line
.Value = c
 
Upvote 0
Oh dear public humiliation the code works fine but I put the code on a different version of the sheet that I had described in the post and the validation list was in a slightly different cell.

My very sincere apologies for wasting your additional time by not spotting this earlier.

Where is the nearest dark room

Again my very sincere thanks for taking the time to help me.
 
Upvote 0

Forum statistics

Threads
1,215,136
Messages
6,123,247
Members
449,093
Latest member
Vincent Khandagale

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