LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 40
Default Help with Mr. Peterson's Code.. Print serially from a Sheet

I have the following problem in Excel (OfficeXP/WindowsXP Version)

1) Workbook name is Equipment.xls.
2) Sheets are in pairs viz. PC, PCDetails, Printer, PrinterDetails,
Server, ServerDetails and so on....
3) C5 has Data Validation to show List = SheetName!ID on all the
sheets. SheetName!ID is a alpha numeric 11 digits xxx???xxxxx... xxx
are alphabets from A to Z and ??? is a 3 digit numbers which increments
as...111, 112, 113, 114 e.g KMC1114DTASM, KMC112DTASM.. and so on.
4) All Details Sheets are designed as a form where Cell C5 value is
used to extract values from its relevant pair sheet... eg PCDetails
will extract values from PC and PrinterDetails will extract values from
Printer and so on...
5) Range names for lookups are defined on each sheet...for PC sheet
PCID (IDs), for Printer Sheet as PrinterID and so on...
6) When I click on C5 .. it shows me a the ID List in a drop down
box...which when selected fill in the relevant details using various
Vlookup...
7) Range name for printing is also defined on each Sheet eg for PC
Sheet as PcDetailsPrint... etc..

My problem is that I need to print the form on the Details Sheet by
selecting one ID after another.., which is very time consuming...
sometimes I need to Print about 30 to 40 forms at a time...by selecting
one by one.

Mr. Dave Peterson was kind enough to give a prompt reply and suggested
the code shown below but it gives me an error as follows:

Run time Error 1004
Application-defined or Object-defined error.

Mr. Peterson Code :

Option Explicit
Sub testme()
Dim StartVal As Long
Dim EndVal As Long
Dim TempVal As Long
Dim iCtr As Long
Dim wks As Worksheet
Set wks = Worksheets("PCDetails")
StartVal = CLng(Application.InputBox(Prom¬pt:="Start with", _
Default:=1, Type:=1))
If StartVal = 0 Then
Exit Sub
End If
EndVal = CLng(Application.InputBox(Prom¬pt:="End with", _
Default:=StartVal + 1, Type:=1))
If EndVal = 0 Then
Exit Sub
End If
If EndVal < StartVal Then
TempVal = StartVal
StartVal = EndVal
EndVal = TempVal
End If
For iCtr = StartVal To EndVal
wks.Range("PCID").Value = iCtr
Application.Calculate 'just in case
wks.Range("PcDetailsPrint").Pr¬intOut preview:=True
Next iCtr
End Sub

Can somebody help me out... so that I can print in groups or may be
select from the Drop down box in C5 for groups... to print the sheets

Thanks in advance

Rashid Khan

 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Active cell counting in particular print page (one sheet having different print area) ananthmca2004 Excel Worksheet Functions 1 November 24th 05 11:29 AM
Why do I get a print error light trying to print an excel sheet ? SMC Excel Discussion (Misc queries) 2 November 5th 05 01:36 AM
Need Code To Print From Code Modules davidm Excel Programming 0 June 7th 05 06:11 AM
how to use Excel to generate alphabet serially Maxwell Excel Worksheet Functions 10 May 7th 05 03:37 PM
Help with Mr. Dave Peterson's Code for Consolidating Many Sheets to One Rashid Khan Excel Programming 2 July 31st 04 07:31 PM


All times are GMT +1. The time now is 11:09 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"