Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Printing only rows with values - newbie question

The most robust is (assuming we can determine by looking at column A -
adjust as appropriate)

Dim rng as Range, Dim numColumns as Long
numColumns = 10
Set rng = Cells(rows.count,1).End(xlup)
do while Trim(rng.Text) = "" and rng.row 1
set rng = rng.offset(-1,0)
Loop
ActiveSheet.PageSetup.PrintArea = Range(cells(1,1), _
rng).Resize(,NumColumns).Address(external:=true)
ActiveSheet.Printout

--
Regards,
Tom Ogilvy



"Hansi" wrote in message
...
Hi.

I'm making a spreadsheet where I'm collecting a lot of prices. I've

figured
out how to sort them, but I'm getting a lot of empty cells in the bottom.
This cells has formulas, and culd later get data, so I cant delete them.

What
I would like to do, is to specify the range Excel should print. What I'm
lokking for, is the rownumber, since the number of columns are given. In
other words, how do I find the rownumber of the last cell with a value in

it,
and print it?

Regards

Hansi



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
Real Newbie newbie question Dave New Users to Excel 0 January 10th 07 07:55 PM
Newbie question Different decimal place values for columns dan yemiola Excel Worksheet Functions 1 June 10th 06 08:18 PM
Newbie to charts question - projecting values between data points 38N90W Excel Discussion (Misc queries) 3 January 6th 05 05:15 AM
Printing only rows with values - newbie question Bernie Deitrick Excel Programming 0 September 15th 04 01:37 PM
Newbie question on deleting duplicate rows Phil Horwood Excel Programming 4 November 26th 03 10:38 PM


All times are GMT +1. The time now is 03:36 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"