Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 49
Default Find the last row and column of the dirty area

Hi,
My problem is that if you enter a value in a cell in say row 65,000 and then
delete it excel will still think the sheet goes to row 65,000. I need to know
what row and column Excel thinks the sheet goes to.
I've found lots of ways to get it to find the real answer but nothing on how
to find out what excel thinks it is.

Thanks MarkS
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8,520
Default Find the last row and column of the dirty area

Try this

'Last row filled in Column A
lngLastRow = ActiveSheet.Cells(Rows.Count, "A").End(xlUp).Row

'Last col filled in Row1
lngLastCol = ActiveSheet.Cells(1, Columns.Count).End(xlToLeft).Column


If this post helps click Yes
---------------
Jacob Skaria


"MarkS" wrote:

Hi,
My problem is that if you enter a value in a cell in say row 65,000 and then
delete it excel will still think the sheet goes to row 65,000. I need to know
what row and column Excel thinks the sheet goes to.
I've found lots of ways to get it to find the real answer but nothing on how
to find out what excel thinks it is.

Thanks MarkS

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,549
Default Find the last row and column of the dirty area


Sub ThisIsIt()
Dim rngCorner As Range
Set rngCorner = Cells.SpecialCells(xlCellTypeLastCell)
MsgBox rngCorner.Address
End Sub
--
Jim Cone
Portland, Oregon USA



"MarkS"

wrote in message
Hi,
My problem is that if you enter a value in a cell in say row 65,000 and then
delete it excel will still think the sheet goes to row 65,000. I need to know
what row and column Excel thinks the sheet goes to.
I've found lots of ways to get it to find the real answer but nothing on how
to find out what excel thinks it is.
Thanks MarkS
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,942
Default Find the last row and column of the dirty area

hi
how much space on a sheet that excel "thinks" has been used is called
UsedRange.
Excel records how much space on a sheet has be used and uses this to do a
number of thinks such set the scroll bars, top and side. some times excel
hicups and looses it reference and UsedRange needs to be reset. a relitive
common post. see this sit on how to reset UsedRange if ever needed....
http://www.contextures.com/xlfaqApp.html#Unused

but to see how much space on a sheet that excel "thinks" has be "used", run
the following macro..
sub howmuchspace()
activesheet.UsedRange.select
end sub

this will highlight the space that excel "thinks" has been used.

regards
FSt1

"MarkS" wrote:

Hi,
My problem is that if you enter a value in a cell in say row 65,000 and then
delete it excel will still think the sheet goes to row 65,000. I need to know
what row and column Excel thinks the sheet goes to.
I've found lots of ways to get it to find the real answer but nothing on how
to find out what excel thinks it is.

Thanks MarkS

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,934
Default Find the last row and column of the dirty area

Or, if the OP needs this information inside his code...

HowMuchSpace = ActiveSheet.UsedRange.Address

--
Rick (MVP - Excel)


"FSt1" wrote in message
...
hi
how much space on a sheet that excel "thinks" has been used is called
UsedRange.
Excel records how much space on a sheet has be used and uses this to do a
number of thinks such set the scroll bars, top and side. some times excel
hicups and looses it reference and UsedRange needs to be reset. a relitive
common post. see this sit on how to reset UsedRange if ever needed....
http://www.contextures.com/xlfaqApp.html#Unused

but to see how much space on a sheet that excel "thinks" has be "used",
run
the following macro..
sub howmuchspace()
activesheet.UsedRange.select
end sub

this will highlight the space that excel "thinks" has been used.

regards
FSt1

"MarkS" wrote:

Hi,
My problem is that if you enter a value in a cell in say row 65,000 and
then
delete it excel will still think the sheet goes to row 65,000. I need to
know
what row and column Excel thinks the sheet goes to.
I've found lots of ways to get it to find the real answer but nothing on
how
to find out what excel thinks it is.

Thanks MarkS


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
find next blank column in set area Kirsty Excel Programming 2 January 8th 09 08:00 AM
Comments - display on dirty Belinda7237 Excel Programming 2 August 29th 08 07:33 PM
excel sheet dirty read and dirty write? DAXU Excel Programming 6 February 21st 08 12:03 PM
using Dirty Method Giselle[_2_] Excel Programming 15 February 7th 06 01:21 AM
How to tell if a range or cell is dirty Carl Rapson Excel Programming 4 February 20th 04 05:09 PM


All times are GMT +1. The time now is 07:06 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"