Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 41
Default 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
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
printing only filled in cells of an inventory? johnkennedy Excel Discussion (Misc queries) 1 February 23rd 10 06:36 PM
How to stop printing untill certain cells are filled in? Matt Excel Discussion (Misc queries) 1 June 2nd 09 09:53 PM
Highlighted Cells and Printing - Excel 2000 Darlene Excel Discussion (Misc queries) 2 September 6th 07 07:32 PM
In Excel 2000, How do you select the whole of a worksheet (Select. Rascal Excel Discussion (Misc queries) 1 March 5th 05 12:03 AM
In Excel 2000, How do you select the whole of a worksheet (Select. Rascal Excel Discussion (Misc queries) 1 March 4th 05 11:59 PM


All times are GMT +1. The time now is 11:53 PM.

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

About Us

"It's about Microsoft Excel"