Inserting rows then deleting data but leaving formulas and formatting

Raven4475

New Member
Joined
Jun 15, 2015
Messages
2
Hi
This is my first post and am new to using code in excel sheets.

I have a spread sheet that is keeping track of requested report from 3rd parties. This sheet will need to be password protected as multiple users will have access, so i am trying to sort out a macro that will allow some one to add a new record at the bottom of the sheet. This new row must have all the formulas and formatting from the previous row but non of the specific data.

I have currently got so far in the code, but i don't know how to delete the data in columns "D, E, G, H, K, M, N & O" of the new row.

Current code:


Option Explicit


Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Selection.Count = 1 Then
If Not Intersect(Target, Range("F3")) Is Nothing Then
Call New_Delta
End If
End If
End Sub


Sub New_Delta()


' Go to last cell
Cells(Rows.Count, 2).End(x1Up).Offset(1, 0).Select


' Copy formula from cell above
Rows(Selection.Row - 1).Copy
Rows(Selection.Row).Insert Shift:=xlDown


End Sub


I also need a way for this macro to work on a password protected sheet

Please can someone help with this

Thanks
 

Excel Facts

Move date out one month or year
Use =EDATE(A2,1) for one month later. Use EDATE(A2,12) for one year later.

Forum statistics

Threads
1,224,386
Messages
6,178,292
Members
452,836
Latest member
knoharra

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top