exclude rows with formulas from range in macro

I made a Data Entry Form that ads or updates rows in a datasheet. With this http://www.contextures.com/exceldataentryupdateform.html as the base. The form has 128 rows and 5 of those are vlookup formulas (row 12, 19, 30, 34, 36) that should be excluded when using the view record navigation buttons. But really have no clue how to do this.

I’m really new to VBA. Use a mac and excel 2011 but it should also run on PC. This is my first project so all help will be greatly appreciated.

Big THX Already 

Martijn

Sub ViewLogDown()

Dim historyWks As Worksheet
Dim inputWks As Worksheet
Dim rngA As Range

Dim lRec As Long
Dim lRecRow As Long
Dim lLastRec As Long
Dim lastRow As Long
Application.EnableEvents = False

Set inputWks = Worksheets("Input")
Set historyWks = Worksheets("Werknemers")
Set rngA = ActiveCell

With historyWks
    lastRow = .Cells(.Rows.Count, "A").End(xlUp).Offset(1, 0).Row - 1
    lLastRec = lastRow - 1
End With

With inputWks
    lRec = .Range("CurrRec").Value
    If lRec < lLastRec Then
        .Range("CurrRec").Value = lRec + 1
        lRec = .Range("CurrRec").Value
        lRecRow = lRec + 1
    historyWks.Range(historyWks.Cells(lRecRow, 3), historyWks.Cells(lRecRow, 128)).Copy
    .Range("D5").PasteSpecial Paste:=xlPasteValues, Transpose:=True
    inputWks.Range("OrderSel").Value = .Range("D5").Value
    rngA.Select
      End If
End With
Application.EnableEvents = True

End Sub

By: Martijn

Leave a Reply

Your email address will not be published. Required fields are marked *