Results 1 to 15 of 15

if exists find last values in variable rows

Threaded View

  1. #15
    Forum Expert snb's Avatar
    Join Date
    05-09-2010
    Location
    VBA
    MS-Off Ver
    Redhat
    Posts
    5,649

    Re: if exists find last values in variable rows

    I think you'd better clean up the 'invoer'sheet :
    delete column A
    remove spaces in columns after the last numerical data.

    It's even simpler with:
    Sub snb()
      On Error Resume Next
      With ThisWorkbook.Sheets("Invoer").UsedRange
          With .Columns(1)
            jj = 1
            .AutoFilter 1, "Medewerker*", xlOr, "Conversie"
            For Each cl In .Offset(1).SpecialCells(xlCellTypeVisible)
                If Left(cl.Value, 1) = "M" Then
                  If jj = 1 Then sq = Cells(1, 20).Resize(.Offset(1).SpecialCells(12).Count \ 2, 4)
                  sq(jj, 1) = cl.Offset(, 1)
                  sq(jj, 2) = ThisWorkbook.Sheets("Conversie Tool").Columns(11).Find(sq(jj, 1), , xlValues, xlWhole).Offset(, 1).Value
                Else
                  sq(jj, 3) = cl.Offset(, 40).End(xlToLeft)
                  sq(jj, 4) = cl.Offset(, 40).End(xlToLeft).Offset(1)
                  jj = jj + 1
                End If
            Next
            .AutoFilter
          End With
      End With
      ThisWorkbook.Sheets("Conversie Tool").Cells(5, 3).Resize(UBound(sq), UBound(sq, 2)) = sq
    End Sub
    Last edited by snb; 09-03-2010 at 11:19 AM.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1