szakharov7723
Board Regular
- Joined
- Jun 22, 2018
- Messages
- 85
- Office Version
- 2019
- Platform
- Windows
Hello, I am trying to create a code to automatically select the range (that can vary horizontally) and print it.
I tried to use this code, but it prints only 1 page regardless the amount of pages needed to print all data in range.
And I don't even understand why it limits it to 1 page.
I tried to use this code, but it prints only 1 page regardless the amount of pages needed to print all data in range.
And I don't even understand why it limits it to 1 page.
Code:
Sub PrintSelection()
'
Range("A1").Select
Range(Selection, Selection.End(xlToRight)).Select
Range(Selection, Selection.End(xlDown)).Select
Selection.PrintOut
End Sub