Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
Luc Luc is offline
external usenet poster
 
Posts: 23
Default Retrieving the last cell in a column and using this row number in a counter

I want the row number of the last cell in a column (column A) to be the 'To'
value in the counter below

For cnt = 1 To 500
.......

So i do not want to put 500 there, but the row of the last cell that
contains a value.(there are empty rows!)
Lets say the last cell would be A5412

What do i have to put there in place of the '500'



Thanx,

Luc

--------------------------------------------------------------------------------
Mijn Postvak In wordt beschermd door SPAMfighter
323 spam-mails zijn er tot op heden geblokkeerd.
Download de gratis SPAMfighter vandaag nog!


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,939
Default Retrieving the last cell in a column and using this row number in

dim lngLastRow as Long

lngLastRow = cells(rows.count, "A").End(xlUp).Row

for cnt = 1 to lngLastRow
--
HTH...

Jim Thomlinson


"Luc" wrote:

I want the row number of the last cell in a column (column A) to be the 'To'
value in the counter below

For cnt = 1 To 500
.......

So i do not want to put 500 there, but the row of the last cell that
contains a value.(there are empty rows!)
Lets say the last cell would be A5412

What do i have to put there in place of the '500'



Thanx,

Luc

--------------------------------------------------------------------------------
Mijn Postvak In wordt beschermd door SPAMfighter
323 spam-mails zijn er tot op heden geblokkeerd.
Download de gratis SPAMfighter vandaag nog!



  #3   Report Post  
Posted to microsoft.public.excel.programming
Luc Luc is offline
external usenet poster
 
Posts: 23
Default Retrieving the last cell in a column and using this row number in

Thanxxxxx,

That did the job !!

Greetzzzzz,

Luc



"Jim Thomlinson" wrote in message
...
dim lngLastRow as Long

lngLastRow = cells(rows.count, "A").End(xlUp).Row

for cnt = 1 to lngLastRow
--
HTH...

Jim Thomlinson


"Luc" wrote:

I want the row number of the last cell in a column (column A) to be the
'To'
value in the counter below

For cnt = 1 To 500
.......

So i do not want to put 500 there, but the row of the last cell that
contains a value.(there are empty rows!)
Lets say the last cell would be A5412

What do i have to put there in place of the '500'



Thanx,

Luc

--------------------------------------------------------------------------------
Mijn Postvak In wordt beschermd door SPAMfighter
323 spam-mails zijn er tot op heden geblokkeerd.
Download de gratis SPAMfighter vandaag nog!




--------------------------------------------------------------------------------
Mijn Postvak In wordt beschermd door SPAMfighter
323 spam-mails zijn er tot op heden geblokkeerd.
Download de gratis SPAMfighter vandaag nog!


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
Adding Counter to column for number of identical file numbers Sam Excel Discussion (Misc queries) 1 September 16th 08 06:48 PM
Retrieving page number count from Word DOC NickHK Excel Programming 5 January 12th 07 05:47 AM
Retrieving data from a corresponding row from a different column fluci Excel Discussion (Misc queries) 3 October 27th 05 05:38 AM
Counter for inserting sequence of numbers in Column C Mike Excel Programming 2 January 12th 05 06:06 PM
Retrieving Value From Column A Kelvin Clayson Excel Programming 1 November 9th 04 06:48 PM


All times are GMT +1. The time now is 12:39 PM.

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"