VBA: Copy/paste/sort/print with several conditions need help

Arthur_

New Member
Joined
Dec 29, 2016
Messages
3
Hello,

i'm new to create macros, i would like to get help with the following.

i want to look in same workbook on sheet 2 range = column A all cell with a value (all cells have a formula)
formula = {=IFERROR(INDEX('sheet3'!$A$2:$A$3000, MATCH(0, COUNTIF($A$1:A1, 'sheet3'!$A$2:$A$3000), 0)), "")}​
if the cell is empty it should stop, than all counted cells should copy only the value and than
it should sort all in ascending order and paste value only in sheet 1
what i want is that the column =15 wide and row height =13.25 it should start to paste the values from A2 till A50, than B2 till B50, than C2 till C50...... till F2
than it should start onA51 till A102 and so on until all values are copied, all data should be delete out off the clipboard

than the macro should print the pages out on the default printer, i have now in the code that it should a print preview because i wanted to look if i can get it working.
i'm now 4 weeks working on it but i always get run time error if i try to add something like the format, or past till A50

my code i have until now is copy paste the formulas not the value.

if some Excel guru would help me on that i would be very happy.

this is the code i have right now.

Code:
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.PasteSpecial xlValues:=Sheets("Printout").Range("A" & i)
         x = x + 1
       End If
       
       'print "Printout" sheet print with preview
        Sheets("Printout").PrintOut preview:=True
        
    End With
        
    End


thank you for looking at this post
 

Excel Facts

Add Bullets to Range
Select range. Press Ctrl+1. On Number tab, choose Custom. Type Alt+7 then space then @ sign (using 7 on numeric keypad)

Forum statistics

Threads
1,223,246
Messages
6,170,987
Members
452,373
Latest member
TimReeks

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top