View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
LynchInOKC LynchInOKC is offline
external usenet poster
 
Posts: 3
Default Printing a specific area containing data and not formulas

Thanks for the info, but as I mentioned I am limited to formulas only.
Although I know there are a lot of things I can accomplish using VBA, I do
not want to impose the use of macros on our customers. I would like to do
this entirely using basic spreadsheet options and/or cell functions...

Any other ideas would be greatly appreciated. Thanks.


"Ron de Bruin" wrote:

You can make the cells white (background color)

Copy/Paste this event in the Thisworkbook module

Where do I paste the code that I want to use in my workbook
http://www.rondebruin.nl/code.htm


Private Sub Workbook_BeforePrint(Cancel As Boolean)
If ActiveSheet.Name = "Sheet1" Then
Cancel = True
Application.EnableEvents = False
Application.ScreenUpdating = False
With ActiveSheet
.Cells.SpecialCells(xlCellTypeFormulas).Font.Color Index = 2
.PrintOut
.Cells.SpecialCells(xlCellTypeFormulas).Font.Color Index = 1
End With
Application.EnableEvents = True
Application.ScreenUpdating = True
End If
End Sub


More info here
http://www.rondebruin.nl/print.htm





--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm


"LynchInOKC" wrote in message ...
I have a similar situation, but I am limited to not using macros as the
spreadsheet is to be sent to customers and we don't want to force the
customer to enable macros....

Is there any way to tell Excel not to print cells that contain formulas but
don't resolve to a value or otherwise resolve to an empty string (i.e. "") or
a blank? Perhaps there is a special character code that the formula could
put in the cells that would prevent them from printing just because they
contain formulas?

Any advice would be greatly appreciated!


"Ken Wright" wrote:

Am I right in thinking that you perhaps have input cells in say Cols A:E or so,
and then some formula cells in say Col F. In Col F you have copied the formula
down quite some way such that as you add data to the cells in Cols A:E then a
value will pop up in Col F for those rows.

If I am correct in that assumption, then assuming you can rely on for example
Col A to only contain data in the rows you wish to print (No formulas returning
blanks etc), then something like the following should work for you:-

Sub PrintData()

Dim LastRw As Long
Dim ColW As Long
Dim Rng As Range

With ActiveSheet
LastRw = .Cells(Rows.Count, "A").End(xlUp).Row
ColW = .UsedRange.Column - 1 + .UsedRange.Columns.Count
Set Rng = .Range(Cells(1, "A"), Cells(LastRw, ColW))

.PageSetup.PrintArea = Rng.Address
ActiveWindow.SelectedSheets.PrintOut Copies:=1
End With

End Sub

--
Regards
Ken....................... Microsoft MVP - Excel
Sys Spec - Win XP Pro / XL 97/00/02/03

----------------------------------------------------------------------------
It's easier to beg forgiveness than ask permission :-)
----------------------------------------------------------------------------



"Jo-Anne" wrote in message
...
Good Day All,

I have a spreadsheet where a number of formulas exist, with no results in
them as yet. Because I have the format set to Acct, $ the rows show up as $-.

I don't want these to print, I only want to print up to and including the
last line with a formula result. I also need it to be dynamic, such that if
data is input into the next row down, the print range will adjust accordingly
- any suggestions ??

Thanks Much


---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.736 / Virus Database: 490 - Release Date: 09/08/2004