Bill Macro

  • Thread starter Frank van Westerloo
  • Start date
F

Frank van Westerloo

Hi all,

I use the following Macro for transferring cell information form one sheet
to another.

----- BEGIN MACRO -----

Public Sub PrintInvoice()
Dim vArr As Variant
Dim i As Long
vArr = Array("Z1", "Z1", "A17", "E47", "B2,B13,E46", "G1", "Z1",
"E25", "E26", "Z1", "E29", "E30", "E31", "E33", "Z1", "Z1", "Z1", "Z1",
"A1", "A3", "A4", "C4", "A20", "A21", "A22")
With Selection.Cells(1)
For i = 1 To 25
Sheets("Sheet2").Range(vArr(i - 1)).Value = _
Cells(.Row, i).Value
Next i
End With
Sheets("Sheet2").PrintOut preview:=True
End Sub

----- END MACRO -----

In the first sheet I have 25 used cells in 1 row... But only a few cells
with information belong to the bill on sheet2.

To solve this problem I used a "DUMP" Cell (Z1).

The new problem is that when I get a print preview and I push print... The
printer also spits out the Dump cells...

This is my last working day and I really want to finish this job.

Could someone please help me out? It's for a non-profit organization.

TIA!

d33ch
 
J

Jim Gordon MVP

Hi Frank,

If the dump cells should not be printed you can hide them.

Format > Cells from the menu. In the dialog box choose a custom format.
Enter three semi-colons in a row
;;;

That hides the cell contents.

-Jim


Hi all,

I use the following Macro for transferring cell information form one sheet
to another.

----- BEGIN MACRO -----

Public Sub PrintInvoice()
Dim vArr As Variant
Dim i As Long
vArr = Array("Z1", "Z1", "A17", "E47", "B2,B13,E46", "G1", "Z1",
"E25", "E26", "Z1", "E29", "E30", "E31", "E33", "Z1", "Z1", "Z1", "Z1",
"A1", "A3", "A4", "C4", "A20", "A21", "A22")
With Selection.Cells(1)
For i = 1 To 25
Sheets("Sheet2").Range(vArr(i - 1)).Value = _
Cells(.Row, i).Value
Next i
End With
Sheets("Sheet2").PrintOut preview:=True
End Sub

----- END MACRO -----

In the first sheet I have 25 used cells in 1 row... But only a few cells
with information belong to the bill on sheet2.

To solve this problem I used a "DUMP" Cell (Z1).

The new problem is that when I get a print preview and I push print... The
printer also spits out the Dump cells...

This is my last working day and I really want to finish this job.

Could someone please help me out? It's for a non-profit organization.

TIA!

d33ch

--
Jim Gordon
Mac MVP

MVPs are not Microsoft Employees
MVP info
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top