Announcement

Collapse
No announcement yet.

Show first cell in column (on Row A)

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Show first cell in column (on Row A)



    Hello,

    I try to show the value in row A.

    With the code
    Code:
    Dim FindString As String
    Dim Rng As Range
    FindString = strSheetname
        If Trim(FindString) <> "" Then
            With Sheets(strSheetname).Range(dat1, dat2)
                Set Rng = .Find(What:=FindString, _
                                After:=.Cells(.Cells.Count), _
                                LookIn:=xlValues, _
                                lookat:=xlWhole, _
                                SearchOrder:=xlByRows, _
                                SearchDirection:=xlNext, _
                                MatchCase:=False)
                If Not Rng Is Nothing Then
                   
                   MsgBox ("en " & Rng.End(xlUp))
                Else
                    MsgBox "Nothing found"
                End If
            End With
        End If
    I want that the cell value in rowA is shown, but the code returns the first non blanc cell above the found range in the column, and not the top cell (on RowA)in the column.
    What is "stronger" then End(xlUp), and goes to the top of the column?

    aisietie

  • #2
    Re: Show first cell in column (on Row A)

    Isn't it
    Code:
    MsgBox ("en " & Rng.EntireRow.Cells(1).Value)

    Comment


    • #3
      Re: Show first cell in column (on Row A)

      Thanks Jindon.
      Buy instead of Entirerow, I need to use Entirecolumn, and then it works.

      Thanks a lot


      aisietie

      Comment


      • #4


        Re: Show first cell in column (on Row A)

        Ahhh

        Show first cell in column

        Of course.

        Comment

        Working...
        X