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
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