Caveman1964
Board Regular
- Joined
- Dec 14, 2017
- Messages
- 127
- Office Version
- 2016
- Platform
- Windows
Hi All,
I made this code using recording. It seems sloppy. I need protect and unprotect BUT.....if you gurus see a better way to write this whole thing......you know what...I'll take it!
Basically, the macro is this,
copying row 7 from sheet 4
pasting row 7 into row 7 into sheet 3
copying info from sheet 2 E5:E17
Pasting info and transposing info the new row of sheet 3
I need to unprotect at beginning of this scenario all sheets and then protect at end.
I would most appreciate any help I can get.
Below is the current code. I recorded it....I don't know how to write this.
Sub SubmitDataNewEntry()
Sheets("Data Collection").Select
Rows("7:7").Select
Selection.Insert Shift:=xlDown, CopyOrigin:=xlFormatFromLeftOrAbove
ActiveSheet.Unprotect "1"
Sheets("DO NOT ALTER").Select
Range("A7:BS7").Select
Selection.Copy
Sheets("Data Collection").Select
Range("A7").Select
ActiveSheet.Paste
Range("A7").Select
Sheets("Complaint Entry").Select
Range("E5:E17").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("Data Collection").Select
Range("A7").Select
Selection.PasteSpecial Paste:=xlPasteAll, Operation:=xlNone, SkipBlanks:= _
False, Transpose:=True
Range("A7").Select
Sheets("Complaint Entry").Select
Application.CutCopyMode = False
Selection.ClearContents
Range("E5").Select
End Sub
I made this code using recording. It seems sloppy. I need protect and unprotect BUT.....if you gurus see a better way to write this whole thing......you know what...I'll take it!
Basically, the macro is this,
copying row 7 from sheet 4
pasting row 7 into row 7 into sheet 3
copying info from sheet 2 E5:E17
Pasting info and transposing info the new row of sheet 3
I need to unprotect at beginning of this scenario all sheets and then protect at end.
I would most appreciate any help I can get.
Below is the current code. I recorded it....I don't know how to write this.
Sub SubmitDataNewEntry()
Sheets("Data Collection").Select
Rows("7:7").Select
Selection.Insert Shift:=xlDown, CopyOrigin:=xlFormatFromLeftOrAbove
ActiveSheet.Unprotect "1"
Sheets("DO NOT ALTER").Select
Range("A7:BS7").Select
Selection.Copy
Sheets("Data Collection").Select
Range("A7").Select
ActiveSheet.Paste
Range("A7").Select
Sheets("Complaint Entry").Select
Range("E5:E17").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("Data Collection").Select
Range("A7").Select
Selection.PasteSpecial Paste:=xlPasteAll, Operation:=xlNone, SkipBlanks:= _
False, Transpose:=True
Range("A7").Select
Sheets("Complaint Entry").Select
Application.CutCopyMode = False
Selection.ClearContents
Range("E5").Select
End Sub