Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Find Last Row or Empty Row in VBA

Hi Folks

I have a sheet that I generate and save using automation from Access, and it
works OK. Problem is I cant add to the previously made sheet. I need to be
able to find the last row with data in the sheet (for a specific column) or
the first empty row.

Any suggestion on the VBA method that is used to do this?

Cheers (TIA)

--
Kahuna
------------


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 691
Default Find Last Row or Empty Row in VBA

Hi Kahuna,

Sub GotoBottomOfCurrentColumn()
'Tom Ogilvy 2000-06-26
Cells(Rows.Count, ActiveCell.Column).End(xlUp).Select
End Sub

since you want the next row
Cells(Rows.Count,ActiveCell.Column).End(xlUp).offs et(1,0).Select
---
HTH,
David McRitchie, Microsoft MVP - Excel [site changed Nov. 2001]
My Excel Pages: http://www.mvps.org/dmcritchie/excel/excel.htm
Search Page: http://www.mvps.org/dmcritchie/excel/search.htm

"Kahuna" wrote in message ...
Hi Folks

I have a sheet that I generate and save using automation from Access, and it
works OK. Problem is I cant add to the previously made sheet. I need to be
able to find the last row with data in the sheet (for a specific column) or
the first empty row.

Any suggestion on the VBA method that is used to do this?

Cheers (TIA)

--
Kahuna
------------




  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Find Last Row or Empty Row in VBA

Spot on David - thanks for the quick response. Exactly what I needed.

--
Kahuna
------------
"David McRitchie" wrote in message
...
Hi Kahuna,

Sub GotoBottomOfCurrentColumn()
'Tom Ogilvy 2000-06-26
Cells(Rows.Count, ActiveCell.Column).End(xlUp).Select
End Sub

since you want the next row
Cells(Rows.Count,ActiveCell.Column).End(xlUp).offs et(1,0).Select
---
HTH,
David McRitchie, Microsoft MVP - Excel [site changed Nov. 2001]
My Excel Pages: http://www.mvps.org/dmcritchie/excel/excel.htm
Search Page: http://www.mvps.org/dmcritchie/excel/search.htm

"Kahuna" wrote in message
...
Hi Folks

I have a sheet that I generate and save using automation from Access, and
it
works OK. Problem is I cant add to the previously made sheet. I need to
be
able to find the last row with data in the sheet (for a specific column)
or
the first empty row.

Any suggestion on the VBA method that is used to do this?

Cheers (TIA)

--
Kahuna
------------






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
To find row is empty or not pol Excel Discussion (Misc queries) 2 July 27th 09 01:22 PM
Find first empty row [email protected] Excel Discussion (Misc queries) 3 July 29th 06 07:52 PM
find the next empty row ASU Excel Discussion (Misc queries) 2 June 12th 06 10:05 AM
Find last empty row poppy Excel Programming 5 July 7th 04 04:43 PM
Find Next Empty Row Myrna Rodriguez Excel Programming 3 June 9th 04 08:32 AM


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