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

What does custom number format of ;;; mean?
Three semi-colons will hide the value in the cell. Although most people use white font instead.

Forum statistics

Threads
1,214,643
Messages
6,120,702
Members
448,980
Latest member
CarlosWin

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