Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Real Newbie newbie question | New Users to Excel | |||
Newbie question Different decimal place values for columns | Excel Worksheet Functions | |||
Newbie to charts question - projecting values between data points | Excel Discussion (Misc queries) | |||
Printing only rows with values - newbie question | Excel Programming | |||
Newbie question on deleting duplicate rows | Excel Programming |