Variable Print Length

I have a worksheet with 10 columns and 1 to 100 rows depending on the 
number of clients we have in a day. I would like to write a macro that 
automatically figures out the print size necessary and prints the sheet 
or sheets necessary to print all the information. For example suppose 
that on day 1 the last row with data is row 20. Since the sheet will 
print 30 rows per page, then the print size would be A1:J30. If, 
however, the number of rows used on day 2 is 49, then  pressing the 
[Print] Button (that would run the macro) would print 2 sheets; the 
first with the first 30 rows and the second with the final 19 rows.
0
livelonger (29)
1/26/2007 1:45:59 AM
excel 39879 articles. 2 followers. Follow

1 Replies
520 Views

Similar Articles

[PageSpeed] 38

Elfego,

By "Print size" do you mean the Print Area?  Normally, it's not necessary to 
do anything special to print a large or small worksheet.  Just Print.  It 
prints it on as many pages as necessary.
-- 
Earl Kiosterud
www.smokeylake.com
-----------------------------------------------------------------------
"Elfego Baca" <livelonger@gmail.com> wrote in message 
news:iZKdnYMZzsXEwCTYnZ2dnUVZ_r-onZ2d@comcast.com...
>I have a worksheet with 10 columns and 1 to 100 rows depending on the 
>number of clients we have in a day. I would like to write a macro that 
>automatically figures out the print size necessary and prints the sheet or 
>sheets necessary to print all the information. For example suppose that on 
>day 1 the last row with data is row 20. Since the sheet will print 30 rows 
>per page, then the print size would be A1:J30. If, however, the number of 
>rows used on day 2 is 49, then  pressing the [Print] Button (that would run 
>the macro) would print 2 sheets; the first with the first 30 rows and the 
>second with the final 19 rows. 


0
someone798 (944)
1/26/2007 1:55:32 AM
Reply:

Similar Artilces:

How do I see print preview in color rather than grayscale?
I'm in Publisher and occassionally want to view the print preview. I've noticed that on my home PC I get gray scale for print preview. At school the view is in color. How can I get a color print preview on my home PC? I'm running Office 2003 at home. When I give my presentation at school in "print preview" mode, it must be in color. I don't want to find out that when I present my publisher document at school it is suddenly in gray scale and I don't know how to change it to color. Is your default printer a laser printer by chance? You need to set it u...

Global variables - again
Hi, When I load my first form in the system, it reads in the following parameters from my INI file. User Name the DOS Path to the Data I store these two value in a global variable and only reference them from that point on. I use the user name to read in a row from the tblUserParm table that has all of the settings for that user. I use the DOS data path to get to different sub-directories under my Access db directory. I will also use it to make automatically re-do my links, but I am not at that point yet. Is this an appropriate use of global variables? Is there...

Truncate Table Table variable
Hi, Sql Server 2005 I am using table variable with in a stored procedure and within a table variable i am using identity field. Sometimes I required to truncate the table variable to rseed the identity, but truncate table variable, dbcc checkident are not working. Any idea... Declare @Columns Table(id Int Identity(1,1), [Name] VarChar(155)); Insert Into @Columns([Name]) Select 'A' Union All Select 'B' Select * From @Columns Truncate Table @Columns Insert Into @Columns([Name]) Select 'X' Union All Select 'Y' Select * From @Columns Ra...

Environment variables
Are Windows XP x64 %environment variables% available to Excel and VB equations? The general answer is yes, but you need to understand that there are different views of the filesystem and registry for 32-bit programs as compared to 64-bit programs and the OS. This also affects things like ODBC sources as well. -- Charlie. http://msmvps.com/blogs/russel <johnsuth@nospam.com.au> wrote in message news:c1.2c.3KklPW$0TR@PC1.BIGPOND.COM... > > Are Windows XP x64 %environment variables% available to Excel and VB > equations? > > ...

Can't print envelopes in Word X or Word 2004
Working on document recently, changed page setup to be 14 x 8-1/2. Word changed normal.dot without prompting me at SAVE (which is my default), after that all documents were 14 x 8-1/2, changing it didn't help. Finally deleted normal.dot, Word then created a new one with 8-1/2 x 11 page setup, the default. However, ever since I changed page setup to 14x8-1/2, I have been unable to print envelopes -- using Envelope Wizard, I insert text, click PRINT, the envelope displays properly on screen -- but print preview shows a blank envelope. And a blank envelope is printed. I upgraded to Office...

Printing "continued" after last line on a page
On a student transcript, I'm trying to find a way, for multi-page transcripts, to print a line with "continued" at the end of details. The student's page is grouped by semesters and the detail lines for the semester are kept together on the page. Therefore the continued line (which is there to prevent extra courses from being typed in) cannot be at the top of the page footer. I want to print it at the bottom of the semester footer and just make it visible when I know this is the last semester group on the page. Is there any way I can know this? The WillContinue proper...

TEMP environment variable
Hi, Does somebody know what happens when I write in the 'TEMP' environment variable more than one directory, seperated by a ';' (For example 'C:\windows\temp ; d:\temp')? Does the OSs (98, 2000, XP) know to use BOTH directories as a temporary directories? Regards, Ram ...

Printing Large Fonts
In Outlook Express, If I print an email I've received, it prints in a very large font. What needs to modified to correct this? Thanks for any help, Sincerely, Luke Luke <anonymous@discussions.microsoft.com> wrote: > In Outlook Express, If I print an email I've received, it > prints in a very large font. What needs to modified to > correct this? Ask in an Outlook Express newsgroup. -- Brian Tillman Smiths Aerospace 3290 Patterson Ave. SE, MS 1B3 Grand Rapids, MI 49512-1991 Brian.Tillman is the name, smiths-aerospace.com is the domain. I don't ...

Printing multiple pages
Maybe not a Vista thing. I'm trying to print 4 pages of the same document on one sheet of A - i.e.. 4 x A6 on one page. I am choosing 'Multiple pages per sheet' from the Page Handling>Page Scaling drop down menu and 4 pages per sheet.. However the preview window shows only one page in the top left corner, and this is what actually prints instead of 4. Can anyone help or point me to a more suitable group pse? On Sun, 14 Feb 2010 20:02:11 -0000, "Trevor" <trevor@nospam@woldsweather.co.uk> wrote: >Maybe not a Vista thing. I'm trying to...

Object variable or With block variable not set
I'm trying to put a command button on a form using the command button wizard and I am getting this message "Object variable or With block variable not set". I cannot figure out what's happening. I tried opening different instances of Access and am getting the same problem with some but not all of my .mdb files. Hope someone can help. Thanks, Laura Laura Its hard to think what it would be with no example... did you edit the code generated by the wizard? or is it the wizard producing the error? Can you paste the code here? cheers Jeff "laura" <replyto@gr...

Access Control variable values in one PropertyPg from another Pro
hi all, i am unable to access the property page control values from another property page. // snippet of the code CPropertySheet dlg(_T("Hellow"), this, 0); one a; //First Property Page two b; //second Property Page three c; //third Property Page dlg.AddPage(&a); dlg.AddPage(&b); dlg.AddPage(&c); dlg.SetWizardMode(); dlg.DoModal(); //================================================ if the first property page contains the ComboBox with some values i am trying to acces the values in the second property page as one* m_Main2 = (one *) GetParent(); CString str; fo...

Printing Envelops using report
I have a report that I use to print envelopes. It is based on a query that has fields: name, addresses 1, address 2, city, state. and zip code. On the report I have four rows that show all the data in above mentioned fields. In case there is no data in the address 2 field, I want the report to reflect only three rows instead of four thus having the fourth row move up in the report so there won't be a double space between the addresses rows and the city, state, and zip code row. What is the best way to accomplish this? Any assistance is greatly appreciated. On Mon, 8 Oct 20...

I can not get excel to print on front and back can anyone help me.
I can not get excel to print on front and back of a page. I tried setting it to duplex printing but that did not work. If there is not a way to do it then can I only print odd and even pages. If so then how? is your printer able to print front and back? See also http://www.rondebruin.nl/print.htm#odd -- Regards Ron de Bruin http://www.rondebruin.nl "damorrison" <davemcochrane@gmail.com> wrote in message news:1138752185.640199.294620@o13g2000cwo.googlegroups.com... > is your printer able to print front and back? > ...

since upgrading to ie8, not everything prints
when I print ms kb articles with ie8, much of the notes, tables & comments don't print ( I have tried with "print background..." on and off) - any idea how to fix this ? thanks -- Steve Paul What OS and service pack? If you are using XP and recently upgraded to SP3 and got IE8 in the process, you probably need new drivers for your printer. "steve paul" <stevepaul@discussions.microsoft.com> wrote in message news:E52108AC-0D99-4073-ABC4-FA59FFA16FF9@microsoft.com... > when I print ms kb articles with ie8, much of the notes, tabl...

Recordset in excel with variables
I have successfully figured out how to retrieve data from a SQL server from within an excel sheet. The thing I can figure out is how I can use variables in that recordset from data in a particular cell. Example : Select * from inventoryAudit *that works currently in my sheet but I need to add a variable to the query Example : Select * from inventoryAudit Where transfer_dte Between varStart And varEnd * varStart & varEnd would be dates entered into 2 cells on the sheet, than a button would be pushed that would run the query and return the results into the sheet This is what I have...

printing html
Help! Every time I try to print a html email in Outlook 2002 the program closes. It just started doing this. I have printed html emails in the past with the same printer. My operating system is Windows 98 ...

Variable instances
Hi, I just want to check that i have the correct understanding of the following premise. I have a Class , say Class A that i use as a base class for two other classes, say Class B and Class C. I declare instance sof each class as follows. ClassB p_BVar = new ClassB( ); ClassC p_CVar = new ClassC ( ); Each class inherits a member variable from the Base Class called bool bStatus; Now if i change this variable using p_BVar->bStaus = .... this change should not be relected in p_CVar since p_BVar and p_CVar are two separate instances and do not point to the same address. Is this a corr...

how to convert a CString variable to unsigned short array one?
Hi, In my unicode VC6 app, how to convert a CString variable to unsigned short array? ....... CString strRst; unsigned short strOleChars[100]; strOleChars = strRst; //??? Thank you. Is ConvertStringToBSTR() what you are looking for? AliR. "David" <David_Wang_Xian@hotmail.com> wrote in message news:e6gbA3avFHA.720@TK2MSFTNGP15.phx.gbl... > Hi, > In my unicode VC6 app, how to convert a CString variable to unsigned short > array? > ...... > CString strRst; > unsigned short strOleChars[100]; > strOleChars = strRst; //??? > > Thank you. > > ...

Printing Daily Calendar shows all tasks instead of only active tasks
In previous versions I would print a day and only get the active tasks if that was the filter applied to the taskpad. When I print a day from Outlook 2003 I am getting all tasks, including completed tasks. Is this by design? ...

Form print
If I have data in A1, B1..........say H1, is it possible when data i subsequently entered into say J1 that a standard form can be triggere to appear which will automatically pick up all or some of the dat entered in A1, B1 etc so that a delivery advice can be printed? Thanks in advanc -- srv5u ----------------------------------------------------------------------- srv5uk's Profile: http://www.excelforum.com/member.php?action=getinfo&userid=2500 View this thread: http://www.excelforum.com/showthread.php?threadid=38618 ...

Referencing Variable Name Worksheets
I'm updating a formatted worksheet every day. I have a macro that processes, lets the user augment, and then saves that days data into a new worksheet with that days date. I need to reference that worksheet the next business day to error check. I cannot : PREVIOUS DATE IS IN CELL A1 s = range("a1").value worksheets(s).select Thank you for any help/suggestions Chris Cameron You might try sheets(1) sheet1 -- Don Guillett SalesAid Software donaldb@281.com "camerons" <camerons@epud.net> wrote in message news:117nvk3b9e8mg06@c...

Excel Printing Question
I currently have a spreadsheet that has many worksheets on it. Is there a way that I can print all the content on all of the worksheets with one click of a button or do I have to click on each individual worksheet and click print? Thank you You can select all the worksheets (click on the first and ctrl-click on subsequent). Or File|Print|Print What (check entire workbook) metaltecks wrote: > > I currently have a spreadsheet that has many worksheets on it. Is there a way > that I can print all the content on all of the worksheets with one click of a > button or do I have to...

print pre-printed forms
Is the any way to use excel to print pre-printed forms ( invoices , etc ) after all datas are entered? Is there any way to design a template for that ? Tks !! Osvaldo Osvaldo I take it that you have a printed form to start with, and you want to put this printed form in the printer and have Excel fill in the blanks. Is that right? You can write a macro to do this but it will be a lot of trial and error to get the code to place the data in the blank spaces correctly. It would be much easier if you design the form in Excel first, then have Excel fill it in with a macro, then have...

how do you print a publisher file as a poster and smaller handout.
I am using Publisher 2003. I have a designed a document that is 11 x17. I need the same document as a smaller 8.5 x 11 or 8.5 x 14 document. Do I have to create another document? Or is there a way I can use the 11 x17 document. When I go to FILE - Page Set up - Paper layout. I can change the size of the documentment the only thing that changes is the paper size the design (text boxes and photos) remain the same size. They do not have the same proportions. The ratios are: 11 x 17 = 1:1.545 8� x 11 = 1:1.294 8�x 14 = 1:1.647 The best you can do is convert it to a .pdf file and then ...

Printing Chart
I have an Epson RX680 Photo All-in-One Printer. I can not get a chart to print using the rear paper feeder. Any suggestions? Thanks. ...