ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   help with print button (https://www.excelbanter.com/excel-programming/362787-help-print-button.html)

create_share

help with print button
 
I have an excel workbook which contains two sheets:

1. Inv
2. Sheet1

The Inv sheet contains these colums:

SEQ ITEM DESC BRAND NAME NAME WHOUSES

All the columns contain data.

The second sheet (Sheet1) contains the Inventory sheet that we want to use
for our Warehouse Inventory. This sheet contains all the columns like INV
sheet but on different places.

There are two cells on sheet1 SEQ=1. SEQ= is on one cell and number 1 is on
second cell. If we change the sequence number from 1 to 2 or 3 it will change
the ITEM CODE and ITEM DESCRIPTION on this sheet according to what is present
on the INV sheet.

The sheet1 contains a print button which will print the Inventory sheet
according to the ITEM NUMBER AND ITEM DESCRIPTION if we change the SEQ number.


The problem is that we want to print between two sequences. The print button
should print multiple sheets on continuous paper with different ITEM CODE AND
ITEM DESCRIPTION.

Like if we ask it to print between SEQ=1 TO SEQ=5. It should print multiple
sheets containing ITEM CODE=1 TO ITEM CODE=5 and ITEM DESCRIPTION=1 TO ITEM
DESCRIPTION=5.

The print button contains the following code:

Private Sub CommandButton1_Click()
Range("F1").Select
ActiveCell.FormulaR1C1 = Range("J1").Value - 2
Y = Range("J1").Value
Z = Range("J2").Value
For X = Y To Z
'Application.Run "MEDICAL.xls!Module1.Button2_Click"
'Exit For

Range("E1").Select
Selection.Copy
Range("F1").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
SkipBlanks _
:=False, Transpose:=False
Range("E1").Select
Application.CutCopyMode = False
ActiveCell.FormulaR1C1 = "=RC[1]+1"
Range("F1").Select
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True

Next X


End Sub


can somebody help???

thankx!






All times are GMT +1. The time now is 05:59 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com