Consulting

Results 1 to 3 of 3

Thread: Macro adds a row and make a change

  1. #1
    VBAX Regular
    Joined
    Aug 2013
    Posts
    56
    Location

    Macro adds a row and make a change

    Hello everyone!


    I plan to create a macro that adds a row with clean cells, keeping the formulas and make +1 to the value of the ID of the previous row.

    fhg9.jpg

    In this case, the next ID value would be 3.

    Help please,
    Cheers

  2. #2
    VBAX Mentor
    Joined
    Jul 2012
    Posts
    398
    Location
    Sub a()
    LR = Cells(Rows.Count, "A").End(xlUp).Row
    Rows(LR).Copy Rows(LR + 1)
    Range("A" & LR + 1) = Range("A" & LR) + 1
    Range("B" & LR + 1 & ":C" & LR + 1) = ""
    End Sub

  3. #3
    VBAX Regular
    Joined
    Aug 2013
    Posts
    56
    Location
    Thanks a lot!! Cheers

Posting Permissions

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