• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Adding Blank Row with Formulas below active Cell

9mmjeep

New Member
I have a tracker in Excel 2013 the has information in column a through n. I have formulas in Column I and N. So I do not have several blank rows at the bottom of my table. I would like only one blank row showing a all times. I am trying to make a Macro to add to an existing macro that will automatically add a blank row with the formulas to the next row after column D has a date entered in. My tracker looks similar to below

Once the start date is entered I have a macro it to automatically sort by date and put it in order. What can I do to the following code to always have a blank row at the bottom

I have attached a PNG of what I am working wiht

Code:
Private Sub Worksheet_Change(ByVal Target As Range)
On Error Resume Next
If Not Intersect(Target, Range("D:D")) Is Nothing Then
Range("D1").Sort Key1:=Range("D2"), _
Order1:=xlAscending, Header:=xlYes, _
OrderCustom:=1, MatchCase:=False, _
Orientation:=xlTopToBottom
End If
End Sub

Thank you for your help
 

Attachments

  • Worker Tracker.PNG
    Worker Tracker.PNG
    13.2 KB · Views: 10
Last edited by a moderator:
Hi,

Welcome to the forum ;)

Can you upload a sample Excel file... from the description it should be simple enough.

Thanks

EDIT: Code to insert row after Active Cell can be:
Code:
Rows(ActiveCell.Offset(1).Row).Insert Shift:=xlDown
 
I had to remove the Conditional formatting, Formulas and the Macros I already have assigned to the workbook in order to attach it. I am tying to keep a blank row at the bottom for individual to input information and once Column D is completed it will auto sort by closest to furthest. I already have the macro for that. I placed the Macro above. I am just trying to copy and place a blank row at the bottom so I will not have to have several blank rows with formulas slowing up the work book.
 

Attachments

  • Work Traker.xlsx
    9.2 KB · Views: 2
I had to change a few things but I have it working now. Thank you for the template to work with. I have learned a lot about VBA the past couple weeks
 
Back
Top