Results 1 to 18 of 18

Thread: Get row number from a closed workbook

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    VBAX Newbie
    Joined
    Jan 2019
    Posts
    4
    Location

    Get row number from a closed workbook

    I am trying to get the row number, where the criteria meets a certain value

    I have been trying with this code:
    Dim wkb As Workbook
    Dim a As Range
    Dim clientwks As Worksheet
    Dim listrange As String
    Dim foundValue As Range
    Dim fundet As Integer
    Dim clientlist As Range
    Dim listen As Range
    Set wkb = Workbooks.Open("Q:\KUNDER\PROJEKTER\HPG\HPG_DB.xlsx")
    Set clientwks = wkb.Sheets("Template_0")
    Set clientlist = clientwks.Range("A1")
    listrange = "PRO123456"
    Set listen = Range("A1", Range("A1").End(xlDown))
    For Each a In listen
        Set foundValue = clientlist.Cells.Find(listrange)
        If Not foundValue Is Nothing Then
            a.Offset(0, 0).Value = foundValue.Row
        End If
    Next a
    Last edited by Aussiebear; 02-08-2025 at 09:05 AM.

Posting Permissions

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