Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27
Default How can I get the last used column in a sheet???


How can I get the last used column in a sheet???
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,236
Default How can I get the last used column in a sheet???

There's an example on the "Last Row/Col in Worksheet" page on my website

--
Rob van Gelder - http://www.vangelder.co.nz/excel


"monika" wrote in message
...

How can I get the last used column in a sheet???



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 391
Default How can I get the last used column in a sheet???

One might use the UsedRange property of the worksheet.
This is the range that has been used, but is only
refreshed on saving & re-opening. It is useful though.

The UsedRange has two properties. Columns.Count and
Rows.Count that return the UsedRange width and
height...ie columns and rows. BUT you need to know where
the UsedRange starts, so you'll need the Column and Row
values too.

So, on a spreadsheet...

With Activesheet.usedRange
LastRowUsed = .Row + .Rows.Count -1
LastColumnUsed = .Column +.Columns.Count -1
End With

Patrick Molloy
Microsoft Excel MVP



-----Original Message-----

How can I get the last used column in a sheet???
.

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
Compare sheet 1 column A numbers with sheet 2 column A number Not and Excel Expert Excel Worksheet Functions 3 November 20th 18 08:24 AM
Ron DeBruin Macro - Moving Sheet Name from Last Column to Column A ScottMSP Excel Worksheet Functions 7 December 12th 08 06:07 PM
Dynamic column chart - copying from Sheet to Sheet. Marko Pinteric Excel Discussion (Misc queries) 1 April 10th 06 12:57 PM
Dynamic column chart - copying from Sheet to Sheet. Marko Pinteric Charts and Charting in Excel 1 April 10th 06 12:57 PM
Compare Sheet Cell to Sheet Column Brenda Excel Worksheet Functions 2 January 4th 06 07:32 PM


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