Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

manipulating the UsedRange object 1

Status
Not open for further replies.

claudehenri

Technical User
May 31, 2003
48
AU
Hi All

I would like to know if there is a way of manipulating the range returned by

worksheet(x).usedrange

or another way of deleting the whole area in one go(as its faster) instead of 1 row at a time
what the problem is is that i print out which an unknown number of lines, so would like to delete them all except for the first few rows (which are my headings)

Claude-Henri
 
Hi Claude-Henri,

You only want to print your headings? Then only print them, for example ...
Code:
[blue]activesheet.usedrange.rows("1:3").printout[/blue]
In the same way you can delete a umber of rows although you might need to make use of the number of rows ..
Code:
[blue]activesheet.usedrange.rows("4:"&activesheet.usedrange.rows.count).delete[/blue]

Enjoy,
Tony

--------------------------------------------------------------------------------------------
We want to help you; help us to do it by reading this: Before you ask a question.
Excel VBA Training and more Help at [url=http://www.vbaexpress.
 
Hi Again

No I don't want to print the headings, i just want to clear all the print outs (so i can start with a clean slate) but keep the headings.

anyway I've figured out how to do it

For Each Item In Worksheets
With Item
Set Temp = .Cells(1, 1).CurrentRegion
Temp.Offset(2).Resize (Temp.Row.Count - 2)
Temp.Clear
End With
Next

Thanks anyway
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top