I'm looking to copy/paste within the same macro, using 2 different methods, ActiveSheet.Paste and Selection.PasteSpecial.
Scenario: Row 1 has a series of cells that I'd like to duplicate to rows 2, 3, 4, etc. However some cells (call it A1) has a formula in it that I'd like to only copy the value from and not the actual formula. Then B1 has a validation list in it that id like to copy/paste into B2. And then C1 has a VLOOKUP formula in it that needs to copied/pasted into C2 to work along with B2.
So A1 would use Selection.PasteSpecial and B1 & C2 would use ActiveSheet.Paste but here's the kicker, I need to put everything in the next available row. This wouldn't be an issue except that columns B & C won't always have "results" in them. Column A will always have some type of value in it but not B & C.
Here's an example of the code I've been working with. Imagine (for the purposes of the above description) DJ23 > AD & EK24 > AG are Column A. EU24:GF24 contain the data validation and VLOOKUP formulas.
Scenario: Row 1 has a series of cells that I'd like to duplicate to rows 2, 3, 4, etc. However some cells (call it A1) has a formula in it that I'd like to only copy the value from and not the actual formula. Then B1 has a validation list in it that id like to copy/paste into B2. And then C1 has a VLOOKUP formula in it that needs to copied/pasted into C2 to work along with B2.
So A1 would use Selection.PasteSpecial and B1 & C2 would use ActiveSheet.Paste but here's the kicker, I need to put everything in the next available row. This wouldn't be an issue except that columns B & C won't always have "results" in them. Column A will always have some type of value in it but not B & C.
Here's an example of the code I've been working with. Imagine (for the purposes of the above description) DJ23 > AD & EK24 > AG are Column A. EU24:GF24 contain the data validation and VLOOKUP formulas.
VBA Code:
Sub NewAM()
With Application
.EnableEvents = False
.ScreenUpdating = False
End With
Range("DJ23").Select
Selection.Copy
Range("AD" & Rows.Count).End(xlUp).Offset(1).Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Range("EK24").Select
Selection.Copy
Range("AG" & Rows.Count).End(xlUp).Offset(1).Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
'Range("EU24:GF24").Select
'Selection.Copy
'Range("AG" & Rows.Count).End(xlUp).Offset(1).Select
'ActiveSheet.Paste
With Application
.EnableEvents = True
.ScreenUpdating = True
End With
End Sub