Hello,
i started to create a macro to copy all data from row "A" from worksheet1 to a different worksheet (worksheet2) and paste it after that a print preview window will shown and it can be printed. i'm not that good in macros.
i struggle to get the some more things done:
i'm not sure if i copy the whole column A or what it should copy only the cell with data not empty cells (in all cells is a code)
first i would like that the data and format is cleared after printing on the worksheet 2
second issue i have is that the data should be copied on a A4 format (means in column A 50 cells column C 50 cells next 50 cells in column E, next 50 should go into column A in the first empty cell, and so on until all cells copied not empty cells are copied from worksheet1. we need column B, D, E to fill in data on the printed A4, each column should be 15 wide and the row should be 13.3 high; on each column and new A4 Page i would like to have the header copied.
the format should also create borders on the cells with data.
this should all happen on push the button print
this is my code i have right now.
Sub Print_Area()
Worksheets("Empty Loc Report").Activate
Dim Selection As Range
Set Selection = Range("A:A")
Selection.Select
'copy cells from sheet1
Dim i As Integer
Sheets("Empty Loc Report").Select
i = 1
'paste copied cells in sheet2
With Range("A1")
If .Cells(1, 1).Value = "" Then
Else
Range(.Cells(1, 1), .End(xlDown)).Copy Destination:=Sheets("Printout").Range("A" & i)
x = x + 1
End If
'print "Printout" sheet print with preview
Sheets("Printout").PrintOut preview:=True
End With
End Sub
it would be nice if someone could help me, if this can be done.
Thank you
A
i started to create a macro to copy all data from row "A" from worksheet1 to a different worksheet (worksheet2) and paste it after that a print preview window will shown and it can be printed. i'm not that good in macros.
i struggle to get the some more things done:
i'm not sure if i copy the whole column A or what it should copy only the cell with data not empty cells (in all cells is a code)
first i would like that the data and format is cleared after printing on the worksheet 2
second issue i have is that the data should be copied on a A4 format (means in column A 50 cells column C 50 cells next 50 cells in column E, next 50 should go into column A in the first empty cell, and so on until all cells copied not empty cells are copied from worksheet1. we need column B, D, E to fill in data on the printed A4, each column should be 15 wide and the row should be 13.3 high; on each column and new A4 Page i would like to have the header copied.
the format should also create borders on the cells with data.
this should all happen on push the button print
this is my code i have right now.
Sub Print_Area()
Worksheets("Empty Loc Report").Activate
Dim Selection As Range
Set Selection = Range("A:A")
Selection.Select
'copy cells from sheet1
Dim i As Integer
Sheets("Empty Loc Report").Select
i = 1
'paste copied cells in sheet2
With Range("A1")
If .Cells(1, 1).Value = "" Then
Else
Range(.Cells(1, 1), .End(xlDown)).Copy Destination:=Sheets("Printout").Range("A" & i)
x = x + 1
End If
'print "Printout" sheet print with preview
Sheets("Printout").PrintOut preview:=True
End With
End Sub
it would be nice if someone could help me, if this can be done.
Thank you
A