Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Last Cell on a Worksheet


I would like to find the last cell used on a worksheet and place it in
variable. If the last cell is L257, I would like it stored as L25
rather than as an integer. I have routines to get the last row and las
column. I can then display the last cell as $L$257 with the following:


Code
-------------------
MsgBox Cells(LastRow, LastColumn).Addres
-------------------


I can then place that value in a string with the following:


Code
-------------------
Dim LastCell As String
LastCell = Cells(LrMaster, LcMaster).Addres
-------------------


The following code will give you an idea of how I want to use it, bu
it is not quite right. How would I specify a range of A2 throug
LastOne similar to what I have below? ("A2:LastOne") will not work.


Code
-------------------
Dim Bcell As Range
For Each Bcell In Worksheets("Master").Range("A2:LastOne")
'routine
Next Bcel
-------------------


Thank

--
David
-----------------------------------------------------------------------
DavidW's Profile: http://www.excelforum.com/member.php...fo&userid=3263
View this thread: http://www.excelforum.com/showthread.php?threadid=57425

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Last Cell on a Worksheet


Hi DavidW,

Try:
For Each Bcell In Worksheets("Master").Range("A2", LastOne)

That should do the trick.

Good luck!


Leonida

--
leonida
-----------------------------------------------------------------------
leonidas's Profile: http://www.excelforum.com/member.php...fo&userid=3537
View this thread: http://www.excelforum.com/showthread.php?threadid=57425

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Last Cell on a Worksheet


Leonidas,

Thank you. That works.

Davi

--
David
-----------------------------------------------------------------------
DavidW's Profile: http://www.excelforum.com/member.php...fo&userid=3263
View this thread: http://www.excelforum.com/showthread.php?threadid=57425

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
populate cell on worksheet 2 if text is red on worksheet 1 SCrowley Excel Worksheet Functions 14 May 15th 07 09:28 PM
How do I take a cell in one worksheet and add it into the formula in a different worksheet in the same workbook? Lexi Excel Worksheet Functions 3 September 20th 06 05:52 PM
link a cell in the 'Master' worksheet list to a 'Detail' worksheet Paul Condron Excel Programming 12 July 16th 06 10:41 PM
How can I link cell colours from worksheet to worksheet/workbook? Evelyn Excel Worksheet Functions 1 July 5th 05 09:16 PM
selecting cell range in other worksheet without switching to worksheet suzetter[_4_] Excel Programming 4 June 22nd 05 08:55 PM


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