Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Excel 2000 VBA: select filled cells for printing
Hello, i would appreciate some help on the following:
Suppose I have a range A1:F200 which is an output of a macro Always, the first couple of cells in column A are filled with different texts and below those, the other cells of the column are filled with the text "1" I need a VBA code that automatically puts a print area around the range that doesn't have "1" in the cell of column A. So, in that way I will be able to print only the significant data which has a text other than "1" in the first cell of the row. Thanks ! Bart |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Excel 2000 VBA: select filled cells for printing
If the data is entered into the cell by VBA code, it would
make sense to set up the print area at the same time- that way you will already know where the first "1" is in column A. If this is not possible, here is a stand alone procedure to do it: Sub SetPrintArea() Dim rngR As Range Set rngR = Sheets("Sheet1").Columns(1).Find(what:="1", lookat:=xlWhole, LookIn:=xlValues) If Not rngR Is Nothing Then Sheets("Sheet1").PageSetup.PrintArea = "A1:A" & rngR.Row - 1 Else Sheets("Sheet1").PageSetup.PrintArea = False End If End Sub Cheers, Dave. -----Original Message----- Hello, i would appreciate some help on the following: Suppose I have a range A1:F200 which is an output of a macro Always, the first couple of cells in column A are filled with different texts and below those, the other cells of the column are filled with the text "1" I need a VBA code that automatically puts a print area around the range that doesn't have "1" in the cell of column A. So, in that way I will be able to print only the significant data which has a text other than "1" in the first cell of the row. Thanks ! Bart . |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
printing only filled in cells of an inventory? | Excel Discussion (Misc queries) | |||
How to stop printing untill certain cells are filled in? | Excel Discussion (Misc queries) | |||
Highlighted Cells and Printing - Excel 2000 | Excel Discussion (Misc queries) | |||
In Excel 2000, How do you select the whole of a worksheet (Select. | Excel Discussion (Misc queries) | |||
In Excel 2000, How do you select the whole of a worksheet (Select. | Excel Discussion (Misc queries) |