Printing same sheet with multiple values from other tab

Joined
Mar 21, 2023
Messages
3
Office Version
  1. 2016
Platform
  1. Windows
I have a main sheet named "EntryData" that changes based on the value selected in a dropdown box named "DropDown1" located on "EntryData".
I am needing to be able to print the "EntryData" sheet for each value presented in "Dropdown1" with out any user interaction other than pushing a button.

Is this possible?
Thanks for any help :)
RS
 

Excel Facts

Difference between two dates
Secret function! Use =DATEDIF(A2,B2,"Y")&" years"&=DATEDIF(A2,B2,"YM")&" months"&=DATEDIF(A2,B2,"MD")&" days"
I have a macro that does something to that effect. It uses a named range as the source for all the items in the list. If you have the items from Dropdown1 in a named range, you can do that fairly simply like this:

VBA Code:
Sub JustHavin()

Dim rngCell As Range

'Loop Through Names And Print Cycle Time Charts
For Each rngCell In Range("nrDropdown1")
   
   Range("A1") = rngCell.Value
   
   ActiveWindow.SelectedSheets.PrintOut _
      Copies:=1, Collate:=True

End Sub
 
Upvote 0
Thanks Wookie,
Having issues running this. I have a defined name range as you suggested "nrDropdown1" that gets its data from the "Clients" tab. $a$1$a$33.
From your code, I only changed the value 4th line to "A33" (as this is the cell, on the sheet named "EntryData" that contains the Dropdown box). I also added a Next statement to end the "For" statement.

However, when I try to run this I get a RunTime '1004' - Method "range of Object" '_worksheet' failed.
I have copied the modified code below.

********************************************************
Sub (jushavin)
Dim rngCell As Range

'Loop Through Names And Print Cycle Time Charts
For Each rngCell In Range("nrDropdown1")

Range("A33") = rngCell.Value

ActiveWindow.SelectedSheets.PrintPreview _
' Copies:=1, Collate:=True
Next
End Sub
 
Upvote 0
Skip it Wookie....figured it out. Its working nnow :)
Thanks again for your help :)
excellent! glad to hear it.

and apologies for missing that NEXT statement; i copy/pasted from existing code and didn't test my code before posting.
 
Upvote 0

Forum statistics

Threads
1,215,108
Messages
6,123,132
Members
449,098
Latest member
Doanvanhieu

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