#1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 4
Default Macro for last row

Hi Experts,

Need your help to get this working.
I'm using the below macro to copy formulas up to the last row.
However, it doesn't work when the worksheet have many rows of data (says
50,000 rows). It works fine for fewer rows.

Function last_row() As Integer

Row = 1
While Cells(Row, 1) < ""
Row = Row + 1
Wend

last_row = Row

End Function


Thanks in advance

--
Freddie
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 10,593
Default Macro for last row

Function last_row() As Long
Dim mRow As Long
mRow = 1
While Cells(mRow, 1) < ""
mRow = mRow + 1
Wend

last_row = mRow

End Function




--
---
HTH

Bob


(there's no email, no snail mail, but somewhere should be gmail in my addy)



"Freddie Ang" wrote in message
...
Hi Experts,

Need your help to get this working.
I'm using the below macro to copy formulas up to the last row.
However, it doesn't work when the worksheet have many rows of data (says
50,000 rows). It works fine for fewer rows.

Function last_row() As Integer

Row = 1
While Cells(Row, 1) < ""
Row = Row + 1
Wend

last_row = Row

End Function


Thanks in advance

--
Freddie



  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 4
Default Macro for last row

Hi Bob,

Thanks alot for your great help.

Regards

--
Freddie


"Bob Phillips" wrote:

Function last_row() As Long
Dim mRow As Long
mRow = 1
While Cells(mRow, 1) < ""
mRow = mRow + 1
Wend

last_row = mRow

End Function




--
---
HTH

Bob


(there's no email, no snail mail, but somewhere should be gmail in my addy)



"Freddie Ang" wrote in message
...
Hi Experts,

Need your help to get this working.
I'm using the below macro to copy formulas up to the last row.
However, it doesn't work when the worksheet have many rows of data (says
50,000 rows). It works fine for fewer rows.

Function last_row() As Integer

Row = 1
While Cells(Row, 1) < ""
Row = Row + 1
Wend

last_row = Row

End Function


Thanks in advance

--
Freddie




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
Macro Help Needed - Excel 2007 - Print Macro with Auto Sort Gavin Excel Worksheet Functions 0 May 17th 07 01:20 PM
My excel macro recorder no longer shows up when recording macro jack Excel Discussion (Misc queries) 1 February 5th 07 09:31 PM
My excel macro recorder no longer shows up when recording macro jack Excel Discussion (Misc queries) 3 February 5th 07 08:22 PM
using a cell value to control a counter inside a macro and displaying macro value ocset Excel Worksheet Functions 1 September 10th 06 05:32 AM
Macro needed to Paste Values and prevent Macro operation thunderfoot Excel Discussion (Misc queries) 1 June 11th 05 12:44 AM


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