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 Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Usedrange or not Usedrange

Status
Not open for further replies.

happymc100

Technical User
May 25, 2004
12
DE
Hi people,
I am using Usedrange to select my area for using special cells to select and fill blank cells. However, how do I do this, but not select the last column of data.
Rgds
Mike
 
One way, but usedrange can be unpredicatable and incorrect:-

Sub PartRange()

Set RngOrig = ActiveSheet.UsedRange

With RngOrig
Cl = .Columns.Count
Rw = .Rows.Count
Set RngNew = .Cells(1, 1).Resize(Rw, Cl - 1)
End With

MsgBox RngNew.Address

End Sub

Regards
Ken.............

----------------------------------------------------------------------------
[peace]It's easier to beg forgiveness than ask permission[2thumbsup]

----------------------------------------------------------------------------
 
Ken,
Thanks for that, It works great. Now all I need id for it to create a virtual Kylie Minogue for me, and I'll be the happiest person in the world ;-)
Cheers
Mike
 
I wouldn't mind getting it to do that for me :)

----------------------------------------------------------------------------
[peace]It's easier to beg forgiveness than ask permission[2thumbsup]

----------------------------------------------------------------------------
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top