Results 1 to 5 of 5

Thread: Returning Row number in data sort

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #4
    snb
    Guest
    This is all you need:

    Sub M_snb()
       sn = Cells(1).CurrentRegion
       ReDim sp(UBound(sn), UBound(sn, 2))
       c00=inputbox("filter item")   
    
        For j = 2 To UBound(sn)
           If sn(j, 1) = c00 or sn(j, 1) = Val(c00)Then
              sp(n, 0) = j
              For jj = 1 To UBound(sn, 2)
                sp(n, jj) = sn(j, jj)
              Next
              n = n + 1
           End If
        Next
          
       If not Isempty(n) Then Workbooks.Add.Sheets(1).Cells(1).Resize(n, UBound(sp, 2)+1) = sp
    End Sub
    Last edited by snb; 06-26-2015 at 02:24 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
  •