wherespete
New Member
- Joined
- Sep 21, 2007
- Messages
- 15
Hello,
Here's a frustrating Excel for Mac 365
I have a very simple macro for printing a selection of cells based on the length of a particular column within the dataset - and yes, I am fairly idiosyncratic in using "Range(Cells(), Cells())" as my syntax.
The range is rarely more than 30 rows long and this is my code:
As you can see, it calculates the row number of the bottom value in column E and creates a selection from row 3 to that row number. And prints it.
Well, it used to in Excel for Mac 11, but now it refuses to select the range and whizzes the entire worksheet to the printer (which is about 14 pages long) instead of the range that I had tried to select. If I print manually, I have to select "Selection" from the Print drop-down menu in the Print dialogue box pop-up, but if I record that action no clear command record in Visual Basic.
Can anyone explain what command I need to put into my code for Excel Mac 365 to recognise a range to print, please? Clearly it doesn't like Range().Select and Selection.PrintOut... ?
Many thanks,
Pete
Here's a frustrating Excel for Mac 365
I have a very simple macro for printing a selection of cells based on the length of a particular column within the dataset - and yes, I am fairly idiosyncratic in using "Range(Cells(), Cells())" as my syntax.
The range is rarely more than 30 rows long and this is my code:
VBA Code:
Sub PrintList()
Application.ScreenUpdating = False
r1 = Cells(20000, 5).End(xlUp).Row
Range(Cells(3, 3), Cells(r1, 6)).Select
Selection.PrintOut From:=1, To:=1, Copies:=1
Cells(1, 1).Select
Application.ScreenUpdating = True
End Sub
As you can see, it calculates the row number of the bottom value in column E and creates a selection from row 3 to that row number. And prints it.
Well, it used to in Excel for Mac 11, but now it refuses to select the range and whizzes the entire worksheet to the printer (which is about 14 pages long) instead of the range that I had tried to select. If I print manually, I have to select "Selection" from the Print drop-down menu in the Print dialogue box pop-up, but if I record that action no clear command record in Visual Basic.
Can anyone explain what command I need to put into my code for Excel Mac 365 to recognise a range to print, please? Clearly it doesn't like Range().Select and Selection.PrintOut... ?
Many thanks,
Pete