LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #11   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 23
Default Detect lines in specific sheet at load time

I'vw now implemented the ting a a note to observe:

The sheet in question has been frormatted and

If rng(rng.Count).Row 10 Then
MsgBox "last row is " & rng(rng.Count).Row
Endif

Does not work as intended (reports 1000 rows), the issue is solved like
this:

Private Function ComputeNextEmptyRow(ByRef sheet As Object, ByVal
startRow As Integer) As Integer
While sheet.Cells(startRow, 1).Value < ""
startRow = startRow + 1
Wend
ComputeNextEmptyRow = startRow
End Function

And this function is called like this:

row = ComputeNextEmptyTripRow(sh, TripStartRow)
If row 10 Then
MsgBox "There are " & row - 10 & " row(s) in AddedInfo sheet."
End If

Thx again for providing clear and useful help

regards,
Ladyhawke

 
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
How to load a list of web links into specific worksheets? Eric Excel Worksheet Functions 0 March 3rd 08 04:32 AM
load event when specific workbook is opened itsthebike[_4_] Excel Programming 2 July 7th 06 05:25 PM
How to detect if sheet is hidden? hstijnen Excel Worksheet Functions 1 March 24th 05 02:40 PM
Excel VBA - Opening a workbook to a specific sheet every time carljonesuk Excel Programming 1 February 9th 04 10:36 AM
Function to detect if Sheet is protected Niklas[_4_] Excel Programming 1 October 7th 03 09:11 AM


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