Consulting

Results 1 to 3 of 3

Thread: Solved: Refer to the Last Row

  1. #1

    Solved: Refer to the Last Row

    Hi everybody
    I learnt to refer to the last row by code
    Now I have column B with formulas until B100 but the results are until B11 and the other cells in the column are bank
    I want to refer to the Last Row to be 11 not 100
    Here's my code but it appears to be 100 not 11
    [VBA]Dim LastRow As Integer
    LastRow = Cells(Rows.Count, 2).End(xlUp).Row
    MsgBox LastRow
    [/VBA]

  2. #2
    Assuming your unwanted rows returns 0 (zero) you can try this..

    [VBA]Dim rFound As Range
    On Error Resume Next
    Set rFound = Columns(2).Find(What:="0", After:=Cells(1, 2), LookIn:=xlValues, LookAt:= _
    xlWhole, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:=False _
    , SearchFormat:=False)
    On Error GoTo 0
    If Not rFound Is Nothing Then Application.Goto rFound, True

    MsgBox rFound.Row[/VBA]

  3. #3
    Thanks a lot for your help
    I appreciate your help Mr. ilyaskazi

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •