set print area from selected range

Hi, I have some code which selected a certain amount of columns depending on 
whether they contain values or not.  Once I have this range set and I select 
it I want to set this as the print area.  I am not quite sure how to do 
this.  for example I tried:

rngUnion.Select
ActiveSheet.PageSetup.PrintArea = ActiveCell.CurrentRegion.Address

But to no avail.  Any help would be gratefully received. 


0
7/12/2006 8:43:09 AM
excel 39879 articles. 2 followers. Follow

3 Replies
610 Views

Similar Articles

[PageSpeed] 37

Try:
ActiveSheet.PageSetup.PrintArea = Selection.address

HTH
--
AP

"Graham Whitehead" <gwhitehead77@hotmail.com> a �crit dans le message de 
news: ut4U27YpGHA.3600@TK2MSFTNGP04.phx.gbl...
> Hi, I have some code which selected a certain amount of columns depending 
> on whether they contain values or not.  Once I have this range set and I 
> select it I want to set this as the print area.  I am not quite sure how 
> to do this.  for example I tried:
>
> rngUnion.Select
> ActiveSheet.PageSetup.PrintArea = ActiveCell.CurrentRegion.Address
>
> But to no avail.  Any help would be gratefully received.
> 


0
ardus.petus (319)
7/12/2006 8:47:39 AM
Thanks, but didnt work.

"Ardus Petus" <ardus.petus@laposte.net> wrote in message 
news:OD1CX$YpGHA.756@TK2MSFTNGP05.phx.gbl...
> Try:
> ActiveSheet.PageSetup.PrintArea = Selection.address
>
> HTH
> --
> AP
>
> "Graham Whitehead" <gwhitehead77@hotmail.com> a �crit dans le message de 
> news: ut4U27YpGHA.3600@TK2MSFTNGP04.phx.gbl...
>> Hi, I have some code which selected a certain amount of columns depending 
>> on whether they contain values or not.  Once I have this range set and I 
>> select it I want to set this as the print area.  I am not quite sure how 
>> to do this.  for example I tried:
>>
>> rngUnion.Select
>> ActiveSheet.PageSetup.PrintArea = ActiveCell.CurrentRegion.Address
>>
>> But to no avail.  Any help would be gratefully received.
>>
>
> 


0
7/12/2006 8:58:45 AM
The code I gave you sets the current selection as printarea.
Select something else!

Cheers,
--
AP

"Graham Whitehead" <gwhitehead77@hotmail.com> a �crit dans le message de 
news: udKElEZpGHA.4208@TK2MSFTNGP04.phx.gbl...
> Thanks, but didnt work.
>
> "Ardus Petus" <ardus.petus@laposte.net> wrote in message 
> news:OD1CX$YpGHA.756@TK2MSFTNGP05.phx.gbl...
>> Try:
>> ActiveSheet.PageSetup.PrintArea = Selection.address
>>
>> HTH
>> --
>> AP
>>
>> "Graham Whitehead" <gwhitehead77@hotmail.com> a �crit dans le message de 
>> news: ut4U27YpGHA.3600@TK2MSFTNGP04.phx.gbl...
>>> Hi, I have some code which selected a certain amount of columns 
>>> depending on whether they contain values or not.  Once I have this range 
>>> set and I select it I want to set this as the print area.  I am not 
>>> quite sure how to do this.  for example I tried:
>>>
>>> rngUnion.Select
>>> ActiveSheet.PageSetup.PrintArea = ActiveCell.CurrentRegion.Address
>>>
>>> But to no avail.  Any help would be gratefully received.
>>>
>>
>>
>
> 


0
ardus.petus (319)
7/12/2006 9:03:23 AM
Reply:

Similar Artilces:

How do I set up an argument which asks for multiple criteria
I am trying to use an argument that asks for one of three criteria (2345P, 8319T, or 7026J) in cell C108, and if it finds it, enters the amount of yet another cell, G108 into cell K108, and if not enters 0 into cell K108. It seems there are too many arguments for the "if" argument, and I can't seem to get the "lookup" argument to work either. Is there another argument I should be working with? Thanks -- Diver Try: =IF(OR(C108="8319T",C108="2345P",C108="7026J"),G108,0) "bj" wrote: > try in K108 > =if(or(c108=&qu...

setting up new outlook mail account
i can not set up a new account on my outlook, i keep saying establish network connection with a correct sign but searching for my mail account shows X can you please advise Are you trying to setup a POP3 mail account or an Exchange account? Also, what version of Outlook are you using? "rashid" <rashid@discussions.microsoft.com> wrote in message news:C59D04C0-C1C9-4BD1-AE00-2009D25B221D@microsoft.com... > i can not set up a new account on my outlook, i keep saying establish > network > connection with a correct sign but searching for my mail account shows X > ...

OWA Set Rule problem
I have successfully install the Exchange 2003 with SP1 in the Windows Server 2003. Anything alright exclude the rules function in OWA. I try to set the rules from any then "move to" or "copy to" specify folder are no problem, but "forward to" other email address, its don't work. I try to input the email address in the contact and then select from the contact, but the result also don't work. The rules can save and I can receive the incoming email in the Exchange 2003/Outlook or OWA, but it don't forward to my specify email address. I try to...

print screen
I have an HP notebook, MS 2007. My Print screen button is also the INSERT box. when I hit PRT SC and paste it into MS Word, it fails to copy it. I also tried ALT+PRT SC and that doesn't copy it to Word either. What should I do? ...

How to keep the application even when show desktop is selected
Hi, I am developing an application which is a sort of reminder of your daily tasks. I want this application to remain on the top right corner of desktop even when "show desktop" is selected. However it gets minimised.........Any helps appreciated. Perhaps you want to consider "Active Channel Technology" and making your display part of the "Active Desktop"? In article <D580FA88-9C89-4D3F-AB9A-8374A9DE266B@microsoft.com>, Katiyar@discussions.microsoft.com says... > Hi, > I am developing an application which is a sort of reminder of your dail...

How do I set the 'Set Synchronizing Client' field
We have a number of outlook clients using CRM that have the 'Set Synchronizing Client' select box greyed out. We need to tick them so that they are able to synchronize tasks etc. Can any one help me find out why these are greyed out and then set them so that they can synchronize thanks In my experience, that checkbox is always greyed out for the first install that is performed for a user. The only time that checkbox becomes active is if a second copy of CRM is installed for a user who already has CRM installed on another PC.... Normally the box is checked and grey. If that is...

How to set backcolour
Hello All I have a continuous form containing a number field (long integer) called [v_colour]. This field contains the number of a certain colour - as per the numbers that are used in the format properties for back colour etc. I would like to set the back colour for the form's [v_colour] text box to be the value of the field: e.g. If the value of [v_colour] in the first record is 255, I want the back colour of the textbox for that record to be bright red. I tried this as the OnLoad event for the form: [v_colour].backcolour = [v_colour].value .... but this resulted in the back colour of...

Copy formula for ranges from diff sheets #2
Unfortunatley then i have to go to every sheet, copy and paste special (transpose) What I need is some sort of formula that will copy the same range fro _all_sheets_ and then paste special (transpose) on to the referenc sheet. ? -- Berni ----------------------------------------------------------------------- Bernie's Profile: http://www.excelforum.com/member.php?action=getinfo&userid=1457 View this thread: http://www.excelforum.com/showthread.php?threadid=26197 Hi not possible with a formula. This would require VBA >-----Original Message----- > >Unfortunatley then i h...

Applying Percent Decrease Across Set Periods
I have a column which includes dates when items were purchased. I have used the DATEDIF function to find the number of years between that date and today's date. I now want to decrease the purchase amount 10% for every year calculated via the DATEDIF function. Any ideas, is this possible, why can't I think...? -- Hunt&amp;Peck ------------------------------------------------------------------------ Hunt&amp;Peck's Profile: http://www.excelforum.com/member.php?action=getinfo&userid=32961 View this thread: http://www.excelforum.com/showthread.php?threadid=527873 ...

Excel 2000 printing
On one particular spreadsheet: I set print area; but "print preview" shows only one column, altho more columns were included in the "print area." Can you help? Many thanks, Joe Joe Maybe the print preview is only showing you page 1 of 2? Andy. "jfgelband" <jfgelband@optonline.net> wrote in message news:050201c3a7fe$34c58ec0$a501280a@phx.gbl... > On one particular spreadsheet: I set print area; > but "print preview" shows only one column, altho more > columns were included in the "print area." > Can you help? > Many t...

can't see photos in my document but they print
Somehow I've made the photos in my MS Publisher document disappear but they are there when I print. I need to see them as I edit and rework pages. What did I do wrong? How can I fix it. Thanks. Ron View, Pictures, detailed display... If this does not solve the issue, then your video/graphics driver needs upgrading. Do this, slide the acceleration down on your adapter: Control panel, Display folder, settings tab, advanced button, troubleshoot tab. If your images appear when you slide the acceleration down, then go to the manufacturer's web site of your graphics card and u...

Set Regional Settings but not Language
Hi I have a multi-language APP en-US, es-ES, it-IT I usually change Languages and Locales by using the CultureInfo to switch Languages System.Globalization.CultureInfo myCI = new System.Globalization.CultureInfo("es-ES"); My issue is - what if the user wants to View App in english and use the Regional Options on a PC in say Spain ??? If I change the CultureInfo to en-US then they can view APP in English ( English satelite assemblies) but date and numbers will be in US format If I change the CultureInfo to es-ES then date and numbers will be in Spain forma...

my pictures appear black but print ok
My pictures appear black. However when I print the publication or convert it to Adobe PDF, they appear normal. On the toolbar, do you have View, Picture display? If so, check to see if the setting is for detailed view. -- Don Vancouver USA "genemis" <genemis@discussions.microsoft.com> wrote in message news:92FD0B58-F86E-4434-8FB3-B5BDFD4B9915@microsoft.com... > My pictures appear black. However when I print the publication or convert > it > to Adobe PDF, they appear normal. Thanks for the suggestion, but it is checked for detailed view. "Don Schmi...

Work Hours setting excludes specified hours from Scheduling
I am miffed by this problem. I specify a work hour schedule for a user. When I schedule a CRM User as a Resource for a Service in Scheduling of a Service Activity with Requested Time of ASAP and click Find Available Times, the values for Avilable Times returned are outside of the Work Hours I specified for the user and not within the work hours. When I drill into the Work Hours for this User, the Calendar view shows Cross Day rather than 8:00AM - 5:00PM I speciied for work hours and editing the hours reveal the correct hours in the Work Hours. What gives? Never mind. Figured out w...

Reading Pane Settings
I did a search for an answer to this question and have not found one. If I missed an answer already posted, please direct me to the right place. I have Outlook 2007 and set up the "right" reading pane for my e-mail. Now when I go to my calendar it is set up the same way - calendar on the left (same size as the inbox) and then there is a blank space to the right that is the size of the reading pane/preview. To the right is the to-do bar (which I have no problem with). I don't know why there is a reading/preview pane on the calendar when there is nothing to preview, and I...

Outlook "Arrange By" option does not retain its setting
In outlook 2007, I use a custom view for my inbox, and I have the Group By option checked to"Automatically group according to arrangement." This has been workn flawlessly until today, when I realized Outlook did not like a particular mouse click; perhaps I clicked on the border of two options or some other anomoly that caused the window toflash once. The end result was that my Arrange By option changed to "From" when I had previously set it to "Conversation." Now, whenever I hange it backto "Conversation," leave the inbox and come back, ...

Can I import 100 addresses into MapPoint, locate and print all?
I want to import and display up to 100 addresses (within a three county area) on a map that I can enlarge and print to a plotter. Can this be done with MapPoint? If so... How? Jaws wrote: > I want to import and display up to 100 addresses (within a three county area) > on a map that I can enlarge and print to a plotter. Can this be done with > MapPoint? > If so... How? MapPoint is a separate product from Excel. Bill From within MapPoint you can import the addresses from an Excel worksheet. I don't work with MapPoint but on experiment using Data>Import I...

interactive buttons, multiple sets
hi folks I'm sure one of you good folks will save my bacon as usual I have a series of websites, all of which exhibit the same odd behavior with interactive buttons. I have a bunch of buttons in the left margin, each of which pulls up ( lets call it ) a chapter, and in each 'chapter' are a number of related pages. On the top of each page is an imbedded page which has 'page numbers' for all the 'pages' in that chapter. So, it's a grid where the 'vertical' buttons in the left margin and the 'horizontal' buttons at the top comb...

The page select buttons in publisher are gone, what do i do?
Normally there are mini page icons at the bottom of publisher when there is more than one page, but I opened my saved leaflet those buttonshad gone. I know the 2nd page is there because when I do a multipage print preview I can see it. What's wrong with publisger, or is it me? View, status bar... -- Mary Sauer MSFT MVP http://office.microsoft.com/ http://msauer.mvps.org/ news://msnews.microsoft.com "Me" <Me@discussions.microsoft.com> wrote in message news:C3B0CCB4-B7D9-4912-B196-8685EBE1784D@microsoft.com... > Normally there are mini page icons at the bottom of p...

How do I set OOR
I have searched the help menu and have had no luck finding out how to set my outlook 200 to send an OOR (Out of Office Reply) Any assistance would be great If you are in an Exchange environment (ask your administrator if you do notknow) you can set the Out of the Office Assistant which is located under Tools. If you are not in an Exchange environment you can create a rule that replies on all e-mails. The downside of this is that you'll have to have your Outlook open all the time for the rules to process. Make sure you set some exceptions (for instance based on the subject field so ...

Set Focus
I have text box that I input data into and I was wondering if it is possible to set focus to the text box and avoid clicking on the box. I thought the term is Set Focus, but can't find any information or example that would help in doing so. Any help would be appreciated .. PPT 2003. Look at the following page for code to set focus on a text box: http://officeone.mvps.org/vba/activate_shape.html - Chirag PowerShow - View multiple PowerPoint slide shows simultaneously http://officeone.mvps.org/powershow/powershow.html "Phil K" <PhilK@discussions.microsof...

How do I print a timeline date range?
I have a timeline that starts in 9/2003 and extends past today. I want to print only a piece of that timeline: 11/1/2005 to 12/31/2005. How do I do that? If you are running Visio 2003, there is an option on the Print Dialog to print current view. So if you zoom into the area you want, you can print just what you see. John... Visio MVP Need stencils or ideas? http://www.mvps.org/visio/3rdparty.htm Need VBA examples? http://www.mvps.org/visio/VBA.htm Common Visio Questions http://www.mvps.org/visio/common_questions.htm Visio Wishlist http://www.mvps.org/visio/wish_list.htm &qu...

Macro to Shade the selected cell
Hello, I am looking for a Excel 2007 macro that when run will shade the selected cell. Say I am in cell B9 and I run the macro, the cell will be shaded Yellow Thank you EggHeadCafe - Software Developer Portal of Choice XML Serializer Generator and Application Perfomance http://www.eggheadcafe.com/tutorials/aspnet/8eb0e68f-5496-4363-9cb9-dd68447ba187/xml-serializer-generator.aspx Turn on macro recorder and record the actions you do interactively. Press ALT+F11 and open the Module code to see what it has written. On Mon, 12 Oct 2009 16:25:42 -0700, Sukie Uppal wrote: >Hello, >I am lo...

Set published amount of calendar information
Hey guys! Is there any way I can have Exchange 2000/2003 force the amount of time published in the outlook calendar? I know that you can go into the the calendar options and set the amount you want published, but is there a way to have exchange require the amount that is published so that I could get everyone to publish a year's worth of calendar data instead of one person being set at 2 months and another at 6 months and another at 12? Thanks! Mike On Thu, 29 Jun 2006 06:18:02 -0700, Mike <Mike@discussions.microsoft.com> wrote: >Hey guys! > >Is there any way I c...

Macro to Print labels in Word
Does anybody know of an Outlook (2003) macro that has been written to print labels in Word (2003)? If there is one, it might be listed at http://www.slipstick.com/contacts/printlabel.htm . You can also just use a mail merge, you know. -- Sue Mosher, Outlook MVP Author of Microsoft Outlook Programming - Jumpstart for Administrators, Power Users, and Developers http://www.outlookcode.com/jumpstart.aspx "Bob S" <drbobsing@nospam.com> wrote in message news:ehiHZJeXEHA.2952@TK2MSFTNGP12.phx.gbl... > Does anybody know of an Outlook (2003) macro that has been ...