Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
Tom Tom is offline
external usenet poster
 
Posts: 25
Default Last record in collumn.

Hello,

how can I find out by VB last record for example in column A (I need number
of row)? Is there some easy way...

Thanx tom


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,302
Default Last record in collumn.

Hi Tom,

Try:

Dim LastRow As Long

LastRow = Cells(Rows.Count, "A").End(xlUp).Row


---
Regards,
Norman



"Tom" wrote in message
...
Hello,

how can I find out by VB last record for example in column A (I need
number of row)? Is there some easy way...

Thanx tom



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default Last record in collumn.

Here's how I do it. This is from VB.NET, so if using VB6 you'll have to
convert it.


This is chopped out of a real app, so at the top, have:

Imports Excel = Microsoft.Office.Interop.Excel


Then XLApplication is declared in the global variables section: (Lot of
people are confused by where globals go, so if you don't know, see
http://klomdark.servebeer.com:8081/M...px?MsgNum=1586)

Dim XLApplication As New Excel.Application


The actual code to find the last row is:

' Determine last row containing data
With XLApplication
..Range("A1").Select()
..Selection.End(xlDown).Select()
LastRowNum = .ActiveCell.Row()



"Tom" wrote in message
...
Hello,

how can I find out by VB last record for example in column A (I need
number of row)? Is there some easy way...

Thanx tom



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default Last record in collumn.

PS: VB.NET usually doesn't know what 'vbDown' means, so declare it in your
globals section:

Const xlDown = -4121 ' Represents CTRL-DownArrow for determining last cell
with data in current row

"Joe Schmoe" wrote in message
news:t_hTe.20471$tT.387@okepread02...
Here's how I do it. This is from VB.NET, so if using VB6 you'll have to
convert it.


This is chopped out of a real app, so at the top, have:

Imports Excel = Microsoft.Office.Interop.Excel


Then XLApplication is declared in the global variables section: (Lot of
people are confused by where globals go, so if you don't know, see
http://klomdark.servebeer.com:8081/M...px?MsgNum=1586)

Dim XLApplication As New Excel.Application


The actual code to find the last row is:

' Determine last row containing data
With XLApplication
.Range("A1").Select()
.Selection.End(xlDown).Select()
LastRowNum = .ActiveCell.Row()



"Tom" wrote in message
...
Hello,

how can I find out by VB last record for example in column A (I need
number of row)? Is there some easy way...

Thanx tom





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
counting if data from one collumn is present in another collumn Amelia Excel Worksheet Functions 1 February 8th 07 10:05 PM
looking for a value in a collumn exceluser2 Excel Worksheet Functions 5 February 8th 06 11:53 PM
Looking up data within a collumn Demitre Excel Discussion (Misc queries) 3 December 21st 05 01:08 AM
Find a value in the collumn and then in that row OxanaB Excel Programming 2 December 2nd 04 06:01 PM
How to find out how many rows do my collumn have? Leon[_3_] Excel Programming 4 December 22nd 03 09:38 AM


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