Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
counting if data from one collumn is present in another collumn | Excel Worksheet Functions | |||
looking for a value in a collumn | Excel Worksheet Functions | |||
Looking up data within a collumn | Excel Discussion (Misc queries) | |||
Find a value in the collumn and then in that row | Excel Programming | |||
How to find out how many rows do my collumn have? | Excel Programming |