**Print Area Macro OR alternative solution! :)

pleasehelpSP

New Member
Joined
Sep 22, 2010
Messages
12
Hi all,

I have 2-ish problems. First, I want to create a format that shades every other line grey in my worksheet - however, Excel won't let me do that because I am using AutoFilters. It says they must be disabled in order to format what I have, but I cant afford to undo them.

So, I thought I would manually (ugh, I know) shade every other row grey up to about a gazillion because I really need the every other line distinction. BUT, when I go to print, it prints ALL of the rows I've shaded grey (ie 50,000 pgs) so I attempted to make a Macro to select the print area of only the cells that have text.

I was given (bc I am code illiterate):

ActiveSheet.PageSetup.PrintArea = Range(Cells(1, 1), Cells.SpecialCells(xlCellTypeLastCell)).Address

Which does set the print area, but still to the last cell formatted.

Can someone help me set the print area to the last row with TEXT or better yet, fix my inital problem??

-SP
 
AlphaFrog,

Well it works great in the test code I made for this, now to put it in the real code. Thanks for your help, I'll let you know how the next part goes.

-malvdh
 
Upvote 0

Excel Facts

Workdays for a market open Mon, Wed, Friday?
Yes! Use "0101011" for the weekend argument in NETWORKDAYS.INTL or WORKDAY.INTL. The 7 digits start on Monday. 1 means it is a weekend.

Forum statistics

Threads
1,216,071
Messages
6,128,623
Members
449,460
Latest member
jgharbawi

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