andrewb90
Well-known Member
- Joined
- Dec 16, 2009
- Messages
- 1,077
Hello!
I Have been trying to find a create way to copy and paste values using VBA, and while it does work perfectly, As I add more cells to my list, the VBA code gets longer and longer. Anyone have any suggestion for how I can consolidate this code? There are multiple other pieces, but they all follow a similar pattern of cell locations, heres the code:
Thank you!
I Have been trying to find a create way to copy and paste values using VBA, and while it does work perfectly, As I add more cells to my list, the VBA code gets longer and longer. Anyone have any suggestion for how I can consolidate this code? There are multiple other pieces, but they all follow a similar pattern of cell locations, heres the code:
VBA Code:
Sheets("Large_Set").Select
Range("AC1:AC1").Select
Application.Run "Module2.DUP1C"
Range("D9").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Sheets("Large_Set").Select
Range("AD1:AD1").Select
Application.Run "Module2.DUP1C"
Range("E9").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Sheets("Large_Set").Select
Range("AE1:AE1").Select
Application.Run "Module2.DUP1C"
Range("F9").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Sheets("Large_Set").Select
Range("AF1:AF1").Select
Application.Run "Module2.DUP1C"
Range("G9").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Sheets("Large_Set").Select
Range("AG1:AG1").Select
Application.Run "Module2.DUP1C"
Range("H9").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Sheets("Large_Set").Select
Range("AH1:AH1").Select
Application.Run "Module2.DUP1C"
Range("I9").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Sheets("Large_Set").Select
Range("AI1:AI1").Select
Application.Run "Module2.DUP1C"
Range("J9").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Sheets("Large_Set").Select
Range("AJ1:AJ1").Select
Application.Run "Module2.DUP1C"
Range("K9").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Sheets("Large_Set").Select
Range("AK1:AK1").Select
Application.Run "Module2.DUP1C"
Range("L9").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Sheets("Large_Set").Select
Range("AL1:AL1").Select
Application.Run "Module2.DUP1C"
Range("M9").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Thank you!