Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
tom tom is offline
external usenet poster
 
Posts: 570
Default Excel print area size

Hello, i am creating an excell sheet by code with Visual Fox Pro. everything
is fine with one exception. i have set the print area to be a certain size,
but my data wcould be larger than that, so when it prints i get the last page
cut off.

is there a way to have the sheet or workbook print area shrink or grow
depending on the data?

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Excel print area size

Don't set a print area. By default, excel prints all the data.

This can be a problem if Excel thinks you usedrange is larger than it
actually is - but if your are creating the sheet, this shouldn't be a
problem.

Otherwise

Activesheet.PageSetup.PrintArea =
ActiveSheet.UsedRange.Address(external:=True)

or if it is like a database

Activesheet.PageSetup.PrintArea = _
ActiveSheet.Range("A1").CurrentRegion.Address(exte rnal:=True)

--
Regards,
Tom Ogilvy


"Tom" wrote in message
...
Hello, i am creating an excell sheet by code with Visual Fox Pro.

everything
is fine with one exception. i have set the print area to be a certain

size,
but my data wcould be larger than that, so when it prints i get the last

page
cut off.

is there a way to have the sheet or workbook print area shrink or grow
depending on the data?



  #3   Report Post  
Posted to microsoft.public.excel.programming
tom tom is offline
external usenet poster
 
Posts: 570
Default Excel print area size

Tom, i removed my line that stated the print area, However i have some other
business that is happening on the sheet also, i am using cells to hold
formula results and then are showing them in the printed sheet.

when i set the print area these cells did not show or print, now they do.

i am a little confused as to my options with this. that is why i set the
print area before, to stop these from printing,

"Tom Ogilvy" wrote:

Don't set a print area. By default, excel prints all the data.

This can be a problem if Excel thinks you usedrange is larger than it
actually is - but if your are creating the sheet, this shouldn't be a
problem.

Otherwise

Activesheet.PageSetup.PrintArea =
ActiveSheet.UsedRange.Address(external:=True)

or if it is like a database

Activesheet.PageSetup.PrintArea = _
ActiveSheet.Range("A1").CurrentRegion.Address(exte rnal:=True)

--
Regards,
Tom Ogilvy


"Tom" wrote in message
...
Hello, i am creating an excell sheet by code with Visual Fox Pro.

everything
is fine with one exception. i have set the print area to be a certain

size,
but my data wcould be larger than that, so when it prints i get the last

page
cut off.

is there a way to have the sheet or workbook print area shrink or grow
depending on the data?




  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Excel print area size

You will have to identify what area you want printed and set that as the
print area rather than using a fixed range. (As I said, if you don't specify
it it prints the usedrange - so if you have cells that are used and you
don't want them printed then you have to identify what you do want printed).
Only you can tell how to identify the appropriate area. If you have a
database style layout and it is separate from data you don't want printed by
at least one blank row and one blank column, then you can use the
currentregion property of any cell within the data you want printed.

--
Regards,
Tom Ogilvy


"Tom" wrote in message
...
Tom, i removed my line that stated the print area, However i have some

other
business that is happening on the sheet also, i am using cells to hold
formula results and then are showing them in the printed sheet.

when i set the print area these cells did not show or print, now they do.

i am a little confused as to my options with this. that is why i set the
print area before, to stop these from printing,

"Tom Ogilvy" wrote:

Don't set a print area. By default, excel prints all the data.

This can be a problem if Excel thinks you usedrange is larger than it
actually is - but if your are creating the sheet, this shouldn't be a
problem.

Otherwise

Activesheet.PageSetup.PrintArea =
ActiveSheet.UsedRange.Address(external:=True)

or if it is like a database

Activesheet.PageSetup.PrintArea = _
ActiveSheet.Range("A1").CurrentRegion.Address(exte rnal:=True)

--
Regards,
Tom Ogilvy


"Tom" wrote in message
...
Hello, i am creating an excell sheet by code with Visual Fox Pro.

everything
is fine with one exception. i have set the print area to be a certain

size,
but my data wcould be larger than that, so when it prints i get the

last
page
cut off.

is there a way to have the sheet or workbook print area shrink or grow
depending on the data?






  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Excel print area size

Just some added,
you could hide rows and columns you don't want printed and then print
without specifying a printarea.

--
Regards,
Tom Ogilvy


"Tom" wrote in message
...
Tom, i removed my line that stated the print area, However i have some

other
business that is happening on the sheet also, i am using cells to hold
formula results and then are showing them in the printed sheet.

when i set the print area these cells did not show or print, now they do.

i am a little confused as to my options with this. that is why i set the
print area before, to stop these from printing,

"Tom Ogilvy" wrote:

Don't set a print area. By default, excel prints all the data.

This can be a problem if Excel thinks you usedrange is larger than it
actually is - but if your are creating the sheet, this shouldn't be a
problem.

Otherwise

Activesheet.PageSetup.PrintArea =
ActiveSheet.UsedRange.Address(external:=True)

or if it is like a database

Activesheet.PageSetup.PrintArea = _
ActiveSheet.Range("A1").CurrentRegion.Address(exte rnal:=True)

--
Regards,
Tom Ogilvy


"Tom" wrote in message
...
Hello, i am creating an excell sheet by code with Visual Fox Pro.

everything
is fine with one exception. i have set the print area to be a certain

size,
but my data wcould be larger than that, so when it prints i get the

last
page
cut off.

is there a way to have the sheet or workbook print area shrink or grow
depending on the data?








  #6   Report Post  
Posted to microsoft.public.excel.programming
tom tom is offline
external usenet poster
 
Posts: 570
Default Excel print area size

Tom, in my Code, i am Hiding the Cells i dont want the user to see when the
open up the sheet.

that Column does have a Space or empty row from the main body of the sheet.

if i set the print area osheet.pagesetup.printarea = "$A$1:I$166" then i
will print out all i need with EXCEPTIONS.
1) if after i create the Data using VFP and paste it into the sheet and it
runs past "
i166" it will not print out anything under that.

90% of the time that set printarea will work.

if i remove the printarea, even though i have hidden cells, they still
printout (one column of data on the last set of pages).

i am having a problem understanding the currentregion and usedrange props
and how i will use them in VFP without a good reference.

i dont mean to act stupid, i have just hit the WALL

Tom

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
set area in excel not giving me option to set print area? J Littlebear Excel Discussion (Misc queries) 4 April 23rd 23 09:04 PM
split print area in excel - One Page Print Cyhill Excel Worksheet Functions 3 November 12th 08 08:39 PM
error: "the copy area & the paste area are not the same size & sh Janis Excel Discussion (Misc queries) 1 September 7th 07 10:58 PM
Macro: how to set a print area of varying size? Dave D Excel Discussion (Misc queries) 1 September 19th 06 12:50 PM
print pages when text area changes in size dizzy Excel Programming 0 January 25th 04 01:28 AM


All times are GMT +1. The time now is 05:20 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"