Results 1 to 3 of 3
  1. #1
    5 Star Lounger
    Join Date
    Feb 2001
    Location
    Dallas plus 20 miles or so, Texas, USA
    Posts
    876
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Row number of last non-blank cell (2000)

    OK, I know I am going to catch it here...brain is on vacation temporarily...

    With below, how do I find the row number of the last non-blank cell i.e. the row number of the last cell in range c48:c67 that is not blank?

    <pre>For b = 1 To Range("c48:c67").End(xlDown).Row
    </pre>


  2. #2
    5 Star Lounger
    Join Date
    Feb 2001
    Location
    Dallas plus 20 miles or so, Texas, USA
    Posts
    876
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Row number of last non-blank cell (2000)

    Never mind, I got it. I was trying to add the non-blank cells in a range to a right click popup menu bar and instead of doing all that, this is what I did...

    End With
    With CommandBars("RCShifts").Controls(3)
    .Caption = "Early"
    For Each cell In Range("c48:c67")
    If cell.Value <> "" Then
    b = b + 1
    .Controls.Add Type:=msoControlButton
    With CommandBars("RCShifts").Controls(3).Controls([img]/forums/images/smilies/cool.gif[/img]
    .Caption = cell.Value
    .OnAction = "EntShifts"
    End With
    End If
    Next
    End With
    b = 1

  3. #3
    Uranium Lounger
    Join Date
    Jan 2001
    Location
    South Carolina, USA
    Posts
    7,295
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Row number of last non-blank cell (2000)

    Try:

    <pre>For b = 1 To Range("C67").End(xlUp).Row
    </pre>

    Legare Coleman

Posting Permissions

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