I want to create a macro that is able to copy certain cells dependant on what is in a title cell, "G1". It should then open a new sheet and paste the cells into the same cells in this new worksheet.
Sub CopyCells()
Select Case Range("G1").Value
Case "PITOT"
ActiveSheet.Range("D4,D5,D6,D7,D8,D9,D10,D11,I4,I5,I6,I7,I8").Select
Selection.Copy
Sheets.Add After:=ActiveSheet
ActiveSheet.PasteSpecial
Case "DP FLOW TRANSMITTER"
ActiveSheet.Range("D4,D5,D6,D7,D8,D9,D10,D11,I4,I5,I6,I7,I8").Select
Selection.Copy
Sheets.Add After:=ActiveSheet
Case Else
'do nothing
End Select
End Sub
I am getting a 1004 error, is this due to the length of the Range I am attempting to copy or mistakes in the syntax of my code?