Help with Mr. Peterson's Code.. Print serially from a Sheet
Then I _think_ the code would boil down to:
Option Explicit
Sub testme()
Dim myRng As Range
Dim myCell As Range
Dim wks As Worksheet
Set wks = ActiveSheet
Set myRng = Worksheets("datavalidationlists").Range(wks.Name & "ID")
For Each myCell In myRng.Cells
wks.Range("ID").Value = myCell.Value
Application.Calculate 'just in case
wks.Range("DetailsPrint").PrintOut preview:=True
Next myCell
End Sub
Just put a button from the forms toolbar on each worksheet and assign the macro
to each button.
(Double check the range names in the code. I used ID and DetailsPrint.)
Dave Peterson wrote:
I think I'd just create an additional workbook level name for the
data|validation.
You can have multiple names refer to the same range.
In fact, you can use the worksheet name and the characters ID to create the
validation range name.
PCID
Then you can use it in the code to get the range you need.
dim myRng as range
dim wks as worksheet
set wks = worksheets("PC")
set myrng = worksheets("datavalidationlists").range(wks.name & "ID")
...
prkhan56 wrote:
Hello Dave,
I wish to thank you for teaching me how to define Local Range Names.
I have no Global Range names in my Workbook now.
I have 3 local names on all my sheets viz.. ID (Dynamic), Data
(Dynamic), and PrintArea (variable rows on each sheet)
But few problems have come ...where I need your help now.
1) I cannot use the local names for Data Validation...and when I try
the following in Data Validation List eg = PC!ID it says 'You may not
use reference to other worksheets for Data Validation criteria. How
can I rectify this?
2) Cell C5 on all the sheets was used in Data Validation...where
previously I had a drop down box which when selected used to populate
other relevant data using Vlookups.
Would you kindly guide me through... How can I achieve the drop down
box and print in groups or may be select from the Drop down box in C5
for groups... to print the sheets?
Thanks once again for all your time and help
Rashid Khan
--
Dave Peterson
--
Dave Peterson
|