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 


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
      End If
End With
Application.EnableEvents = True

End Sub

By: Martijn

2,662 thoughts on “exclude rows with formulas from range in macro

  1. genolyze

    I’m more than happy to find this great site. I wanted to thank you for ones time for this fantastic read!! I definitely really liked every little bit of it and I have you saved to fav to look at new stuff on your blog.

  2. moedah

    Good web site you have here.. It’s difficult to find high quality writing like yours nowadays. I really appreciate individuals like you! Take care!!

  3. poboleda.org

    I’d like to thank you for the efforts you have put in penning this blog. I really hope to check out the same high-grade blog posts by you in the future as well. In truth, your creative writing abilities has motivated me to get my own blog now 😉

  4. https://iamgutsclub.com/

    Can I simply say what a comfort to uncover someone that really knows what they are talking about online. You certainly realize how to bring an issue to light and make it important. More people must look at this and understand this side of the story. I was surprised that you aren’t more popular since you certainly possess the gift.

  5. Agen Poker Terpercaya

    We’re a group of volunteers and opening a new scheme in our community. Your website offered us with valuable information to work on. You have done a formidable job and our entire community will be grateful to you.|

  6. eyfas.com

    I want to to thank you for this very good read!! I absolutely loved every little bit of it. I’ve got you bookmarked to look at new things you post…

  7. news

    Hi there it’s me, I am also visiting this website regularly,
    this site is truly fastidious and the people are in fact
    sharing fastidious thoughts.

  8. tokoonline88.com

    The next time I read a blog, I hope that it won’t disappoint me just as much as this one. After all, I know it was my choice to read, but I really believed you would have something interesting to say. All I hear is a bunch of complaining about something you can fix if you weren’t too busy seeking attention.

Comments are closed.