Macro: ajust the print of a range to 1 page wide/tall

Hey guys
It annoys me that I constantly have to ajust my prints to 1 page tall/
wide by using the printing tools, and put my self together in
intention to program a little piece of macro that will give me joy and
laughter back...
However - my skill are not as big as my selfconfidence, and failed -
so I have to send this discrete inquiry to the people of Excel-jungle
- full of vulnerable expectation of getting some help here.

My prosedure:
The user marks his range.
The macro prints this as ajusted 1 page print.

My effort:
    ActiveSheet.PageSetup.PrintArea = "B1:N53"
    With ActiveSheet.PageSetup *** bla bla bla
    End With

    ActiveSheet.PageSetup.PrintArea = "B1:N53"
    With ActiveSheet.PageSetup *** bla bla bla
        .FitToPagesWide = 1
        .FitToPagesTall = 1 *** bla bla bla
    End With

    ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True

My problem.
PrintArea = "B1:N53" is constant what-so-ever

I hope the ussue is cearly presented and will be very grateful to be
helped

Regards
Snoopy

0
blaksnm (91)
8/14/2007 9:15:58 AM
excel 39879 articles. 2 followers. Follow

3 Replies
506 Views

Similar Articles

[PageSpeed] 18

Snoopy, FitToPage doesn't want to work unless you explicitly set zoom to 
false.  Also, if you want to print the entire sheet, don't set the print 
area.  I also added a line to go ahead and print the sheet.  HTH, James

Sub PrintToFit()
    With ActiveSheet.PageSetup
        .PrintArea = ""
        .Zoom = False
        .FitToPagesWide = 1
        .FitToPagesTall = 1
    End With
    ActiveSheet.PrintOut
End Sub

"Snoopy" <blaksnm@jjuc.no> wrote in message 
news:1187082958.951917.173930@w3g2000hsg.googlegroups.com...
> Hey guys
> It annoys me that I constantly have to ajust my prints to 1 page tall/
> wide by using the printing tools, and put my self together in
> intention to program a little piece of macro that will give me joy and
> laughter back...
> However - my skill are not as big as my selfconfidence, and failed -
> so I have to send this discrete inquiry to the people of Excel-jungle
> - full of vulnerable expectation of getting some help here.
>
> My prosedure:
> The user marks his range.
> The macro prints this as ajusted 1 page print.
>
> My effort:
>    ActiveSheet.PageSetup.PrintArea = "B1:N53"
>    With ActiveSheet.PageSetup *** bla bla bla
>    End With
>
>    ActiveSheet.PageSetup.PrintArea = "B1:N53"
>    With ActiveSheet.PageSetup *** bla bla bla
>        .FitToPagesWide = 1
>        .FitToPagesTall = 1 *** bla bla bla
>    End With
>
>    ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True
>
> My problem.
> PrintArea = "B1:N53" is constant what-so-ever
>
> I hope the ussue is cearly presented and will be very grateful to be
> helped
>
> Regards
> Snoopy
> 


0
8/14/2007 12:36:14 PM
On 14 Aug, 14:36, "Zone" <KingOfWhi...@aol.com> wrote:
> Snoopy, FitToPage doesn't want to work unless you explicitly set zoom to
> false.  Also, if you want to print the entire sheet, don't set the print
> area.  I also added a line to go ahead and print the sheet.  HTH, James
>
> Sub PrintToFit()
>     With ActiveSheet.PageSetup
>         .PrintArea = ""
>         .Zoom = False
>         .FitToPagesWide = 1
>         .FitToPagesTall = 1
>     End With
>     ActiveSheet.PrintOut
> End Sub
>
> "Snoopy" <blak...@jjuc.no> wrote in message
>
> news:1187082958.951917.173930@w3g2000hsg.googlegroups.com...
>
>
>
> > Hey guys
> > It annoys me that I constantly have to ajust my prints to 1 page tall/
> > wide by using the printing tools, and put my self together in
> > intention to program a little piece of macro that will give me joy and
> > laughter back...
> > However - my skill are not as big as my selfconfidence, and failed -
> > so I have to send this discrete inquiry to the people of Excel-jungle
> > - full of vulnerable expectation of getting some help here.
>
> > My prosedure:
> > The user marks his range.
> > The macro prints this as ajusted 1 page print.
>
> > My effort:
> >    ActiveSheet.PageSetup.PrintArea = "B1:N53"
> >    With ActiveSheet.PageSetup *** bla bla bla
> >    End With
>
> >    ActiveSheet.PageSetup.PrintArea = "B1:N53"
> >    With ActiveSheet.PageSetup *** bla bla bla
> >        .FitToPagesWide = 1
> >        .FitToPagesTall = 1 *** bla bla bla
> >    End With
>
> >    ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True
>
> > My problem.
> > PrintArea = "B1:N53" is constant what-so-ever
>
> > I hope the ussue is cearly presented and will be very grateful to be
> > helped
>
> > Regards
> > Snoopy- Skjul sitert tekst -
>
> - Vis sitert tekst -

Holy Cow! You are a genius!!
Thanks a lot zone

Kindly regards
Snoopy

0
blaksnm (91)
8/14/2007 12:56:22 PM
Glad to help.  Thanks for the feedback and kind words!  Cheers, James

"Snoopy" <blaksnm@jjuc.no> wrote in message 
news:1187096182.148788.80440@g4g2000hsf.googlegroups.com...
> On 14 Aug, 14:36, "Zone" <KingOfWhi...@aol.com> wrote:
>> Snoopy, FitToPage doesn't want to work unless you explicitly set zoom to
>> false.  Also, if you want to print the entire sheet, don't set the print
>> area.  I also added a line to go ahead and print the sheet.  HTH, James
>>
>> Sub PrintToFit()
>>     With ActiveSheet.PageSetup
>>         .PrintArea = ""
>>         .Zoom = False
>>         .FitToPagesWide = 1
>>         .FitToPagesTall = 1
>>     End With
>>     ActiveSheet.PrintOut
>> End Sub
>>
>> "Snoopy" <blak...@jjuc.no> wrote in message
>>
>> news:1187082958.951917.173930@w3g2000hsg.googlegroups.com...
>>
>>
>>
>> > Hey guys
>> > It annoys me that I constantly have to ajust my prints to 1 page tall/
>> > wide by using the printing tools, and put my self together in
>> > intention to program a little piece of macro that will give me joy and
>> > laughter back...
>> > However - my skill are not as big as my selfconfidence, and failed -
>> > so I have to send this discrete inquiry to the people of Excel-jungle
>> > - full of vulnerable expectation of getting some help here.
>>
>> > My prosedure:
>> > The user marks his range.
>> > The macro prints this as ajusted 1 page print.
>>
>> > My effort:
>> >    ActiveSheet.PageSetup.PrintArea = "B1:N53"
>> >    With ActiveSheet.PageSetup *** bla bla bla
>> >    End With
>>
>> >    ActiveSheet.PageSetup.PrintArea = "B1:N53"
>> >    With ActiveSheet.PageSetup *** bla bla bla
>> >        .FitToPagesWide = 1
>> >        .FitToPagesTall = 1 *** bla bla bla
>> >    End With
>>
>> >    ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True
>>
>> > My problem.
>> > PrintArea = "B1:N53" is constant what-so-ever
>>
>> > I hope the ussue is cearly presented and will be very grateful to be
>> > helped
>>
>> > Regards
>> > Snoopy- Skjul sitert tekst -
>>
>> - Vis sitert tekst -
>
> Holy Cow! You are a genius!!
> Thanks a lot zone
>
> Kindly regards
> Snoopy
> 


0
8/14/2007 1:12:33 PM
Reply:

Similar Artilces:

Macro warning with no macros
I have a workbook that when I try to open it I get the warning tellin me it contains macros and asking whether I want to Enable or Disabl them. I put no macros, no VB scripts, nothing at all in the workboo other than standard Excel formulas and some charts. I developed it i Excel 2002, SP-2, but have moved it back and forth between tw computers, the other which has Excel 97. Regardless of whether Enable or Disable or change the security settings so as not to get th warning, once the workbook is open even if I go t Tools-Macro-Macros... it lists no macros. How can I find out what's cau...

Macro
Can anybody tell me how to kick off a macro automatically as file is opened? Regards ...

Macro
Version: 2008 Operating System: Mac OS X 10.4 (Tiger) Processor: intel Hi, I'm thinking of buying Mac: Office 2008, but before I do I want to check that I will be able to download Scritpsmart collection of templates without any glitches: <http://www.bbc.co.uk/writersroom/scriptsmart/faq.shtml> Does anyone know if I can do this? Regards, SP. In article <ee98ff5.-1@webcrossing.caR9absDaxw>, StregaItalia@officeformac.com wrote: > Version: 2008 > Operating System: Mac OS X 10.4 (Tiger) > Processor: intel > > Hi, > > I'm thinking of buying Mac: Of...

Is there a formular or format to change 1 to one
Is there a formular or format to change a number "1" into the word "one". Hi Kevin, See: http://www.xldynamic.com/source/xld.xlFAQ0004.html --- Regards, Norman "Kevin" <Kevin@discussions.microsoft.com> wrote in message news:3C099B0B-82F6-44FB-AD72-B0F726256F96@microsoft.com... > Is there a formular or format to change a number "1" into the word "one". See http://www.xldynamic.com/source/xld.xlFAQ0004.html -- HTH RP (remove nothere from the email address if mailing direct) "Kevin" <Kevin@discussions.micro...

Help with macro/and or formula?
Perhaps this is a silly question, but i just can't figure out how t format this worksheet. The problem is that a lot of the cells hav numbers in them with negative signs in the back instead of in the fron (ie. 23-) and i was wondering if anyone knew of a macro/formula i coul use to quickly fix this problem for all the cells. I would b extremely grateful. Thanks -- brefed1 ----------------------------------------------------------------------- brefed15's Profile: http://www.excelforum.com/member.php?action=getinfo&userid=3557 View this thread: http://www.excelforum.com/showthre...

Favorite Reports on Home Page
Is there a way to display one or more of my favorite reports on the home page? In microsoft.public.money, Kane wrote: >Is there a way to display one or more of my favorite reports on the home page? No. The choices you can choose from on the "home" page are fixed. ...

Run macro automatically.
How do I make a macro run automatically when a worksheet it is attached to is loaded? right click on the sheet tab>view code>left window worksheet>right window activate -- Don Guillett SalesAid Software donaldb@281.com "Excel macro" <Excel macro@discussions.microsoft.com> wrote in message news:DD7AF1E3-9263-4523-AC49-A43ABA1AB9D0@microsoft.com... > How do I make a macro run automatically when a worksheet it is attached to is > loaded? I am unable to find "activate " when I right click on worksheet. ( i assume that you are referring to the windo...

Terminal Server based Outlook 2007 printing hieroglyphics
We are running terminal services(Server 2008 R2) with Outlook 2007 installed (SP2). No other Office components are installed. When printing emails, (all other printing is fine), the text becomes compressed and looks like hieroglyphics. 1. I have tried removing all printer drivers and re-installing the drivers with no luck. 2. I have also applied the lastest patches and Service packs to the server and Outlook. 3. I have tried using different types of drivers with each printer ie. PS, MS, PCL5e, PCL6 etc with no luck. Any help would be appreciated as users are getting very fr...

Excel separator pages
When printing multiple copies of a spreadsheet if it is set to collate I get multiple separator pages 1 for each copy, if I turn off the collate option, I only get 1 separator page. Can this be adjusted in any way so I don't get multiple separator pages even when I use the default collate option?? ...

Attached Toolbars Macros
Excel 2003 I have a custom tool bar, this tool bar has several items, each item is pointing to a VBA code. This tool bar is attached to the worksheet. I've copied this spreadsheet to several computers. After I copied the spreadsheet I decided to rename the spreadsheet, after I renamed the spreadsheet the Toolbar Item's macros were still pointing to the old name, I reasigned each tool bar item to the current spreadsheet, saved the spreadsheet and everything was working on my computer, but when I re-copied the new spreadsheet to other computers and I clicked on the Toolbar Item...

How to write XML to the rendered HTML page.
In code behind, I generate a string that I would like to have rendered to my page so that my javascript can load it into a client side javascript xml document. If I use repsonse.write(txml), it puts it outside of the body of the document. I also tried assigning it to a label.text, but the javascript can not find it inside the span tag. Is there a way to do it? Thanks in advance. txml = "<xml ID='oPriceBookDrops'>" txml = txml & "<PBInfo>" txml = txml & "<DataPoint>" txml = txml & "<Product ProductName='Scre...

Printing checks without printing EFT's
We pay vendors using mostly EFT's but still pay some via check. First we run EFT's and then run checks separately. However sometimes the check batch also includes EFT's thus we need a method to select checks only. Question is how can I select only the check vendors for payment. When paying via EFT, there is a selection for "EFT Only" but no such selection for "Checks Only". Is there a way around this issue? Doug Hi Doug I was browsing and saw this, we had a similar scenario We solved it by using payment priority within the creditor (under options) ...

Protected sheets and running macros
i have a sheet with a macro ran by a normal button at the top. Howeve when i protect the worksheet where ever i click on the sheet the macr executes. Can any one offer any advice on how to stop this? Thanks Robert -- Message posted from http://www.ExcelForum.com hi, i am not able to reproduce the problem, hence i may not be able t provide a panacea for that issue. here is what i suggest. i have a sheet that has a macro that is run when a control toolbo button (that is, not a form button) is clicked. this sheet is protected based on the user logged in. what i have don is to protect t...

Banding when printing Gradients in Excel 2007
I use complex spreadsheets with macros to report company sales data. The reports were created in Excel 2002. When I print the charts from 2002, they print fine... text is crisp and gradients are gradients. When I print the same charts in Excel 2007, the gradients don't print. Rather I get a series of four distinct color bands. The lines and text are also not crisp but rather jagged. We use a color "powerhouse" laser printer -- Gestener aka Ricoh (too many copies to print on an inkjet). Has anyone had this problem? Anyone know of a fix? ...

Macro Freezes Reading Pane
I have a macro that Sends/Receives Tasks from Project Server into Outlook Tasks. Everything is working fine, except one weird thing that happens. I have the Timer set on the macro and it starts as soon as Outlook starts. The macro gets the tasks from ProjectServer every hour. As soon as the macro starts running the Reading pane freezes in the Inbox. If i stop the macro then Reading pane is back to normal. Can anyone please tell me if there is something I can do in VBA to fix this annoying issue. Thanks a lot ...

Macro to remove rows?
Hi, I receive thousands of rows of data from an extract that comes from a database. The data extract automatically generates page headers that need to be removed, and I would love to automate this process. The headers do have a pattern to them, but I'm not clever enough to figure out a good way to use that to write a macro. The first row of the header starts with hyphens ------------------------------- Then there's a variable number of rows of header data to delete followed by another row of hyphens ------------------------------- Then 2 additional rows that must be deleted. The nu...

Calling on a macro within a macro!
Hey All!! Quick Question - How do you call up a macro within a current macro? I have one big macro and I need it to jump to several other macros when it runs! Does it matter where the other macros are stored or is it better to have them all in one module? Help appreciated Thnx! Hi Mellowe, '=============>> Public Sub Main() 'Your code Call One 'your code End Sub '<<============= '=============>> Public Sub One() MsgBox "Hi from One" End Sub '<<============= > Does it matter where the other macros are stored or ...

How do I get my publisher 2003 documents to print to the edge of .
How can I get documents to print to the edge of a page in Publisher 2003? I want my picture to bleed to the edge and have set all gaps to 0. Yet I still get a big white border around each side of the page as opposed to the graphics printing to the edge. Ple Is your printer capable of doing that? Not all are. -- JoAnn Paules MVP Microsoft [Publisher] "Macey" <Macey@discussions.microsoft.com> wrote in message news:C4FA27CF-D2F2-47E7-B35D-D100ABF3B70A@microsoft.com... > How can I get documents to print to the edge of a page in Publisher 2003? > I > want my pi...

receipt printing #5
How do I print a receipt prior to tendering? I know that you can create a Quote and then print, but what a mess. ...

Top margin shifts when viewed in print preview
This happened in Pub 97. Just installed Pub 2003, same thing. An 8.5 x 11 landscape page with margin guides all set at .2 inches (for Minolta 3300), also vertical and horizontal ruler guides and grid guides set at 2 columns and rows spaced at .4 inches. The same graphic is in each quadrant filling the bordered area. (Four postcards with an even border when the page is cut into quarters). Looks great until I view the print preview or print it, then it views and prints with a top margin of 6mm or about .25 inch. I don't think it's my printer properties, as I have printed it ...

How do you print the membership of a distribution group in E2k3
How do you print the membership of a distribution group in E2k3 In 5.5, there was the awkward workaround to "add (or remove) a member, then highlight all the users from their and copy them to the clipboard and paste them in a text file. Don't see "export contents" - You can but it's blank. Don't see any way to get to a copyable list. What am I missing? believe it or not, the easiest way is via Outlook... Create a new meeting request...select the group to invite. Then "expand" the group in the attendee availability window. Then select all of the membe...

shortcut keys to macros
Hi, Is it at all possible to assign shortcut keys to macros in Outlook? Thx, Hans ...

Can i print copy numbers?
At my job we must print copies of databases and keep track of them. We only print 100 copies at a time. Is there a way to make it automaticly put "1 of 100" or "copy 1 of 100" in the footer?? You could run a little macro: Option Explicit Sub testme() Dim iCtr As Long For iCtr = 1 To 3 '100 when you're ready With ActiveSheet .PageSetup.RightFooter = "Copy " & iCtr & " of 100" .PrintOut preview:=True 'false when you're ready End With Next iCtr End Sub I used 1 to 3 and pri...

help Unable to record Macro !!!!!!!
I want to record a macro in excel.But as soon as I click record Macro it says "unable to record" macro. Got no help in excel help.I do this same thing in word and it's working. Please help It's urgent for me !!!1 Have a look here http://groups.google.com/groups?as_epq=unable%20to%20record&as_ugroup=microsoft.public.excel.* -- Don Guillett SalesAid Software donaldb@281.com "ash" <anonymous@discussions.microsoft.com> wrote in message news:3e0b01c42ae5$45333e00$a401280a@phx.gbl... > I want to record a macro in excel.But as soon as I click > record...

Can I print 3 weeks of a monthly calendar rather than all 4/5 week
I realize that Outlook prints the number of weeks which are contained in the month reqested. This month, January, there are 6 weeks, therefore the calendar is printing 6 weeks and is very cluttered. I would like to print 3 weeks only...the week we are in and the following 2 weeks. There is an option to choose print dates (start and end dates) but the default always prints the 6 weeks from the start date but doesn't allow the end date I have chosen. 3 Weeks show up on the screen by highlighting the calendar, but it won't print just 3 weeks even by inserting the end dat...