VBAExpertWannabe
New Member
- Joined
- Jan 8, 2020
- Messages
- 10
- Office Version
- 2019
- Platform
- Windows
I'm trying to do a macro where I will copy data for a column that will be dynamic in Sheet 2, to the current worksheet, Column D. The dynamic column are months, January, February, March...and I want a macro so that if I input the month of "12", that, it will pick that column and then copy the entire column over to the first tab. So I guess I need a mechanism for tying the month to a column name/number?
Right now, my code is static but would like to make it dynamic.
Please see screenshots below.
Right now, my code is static but would like to make it dynamic.
VBA Code:
Sub CopyPaste()
Windows("book1.xlsm").Activate
Worksheets("Actual Budget").Activate
Range("M4").Select
Range(Selection, Selection.End(xlDown)).Select
Selection.Copy
Worksheets("DECEMBER Summary").Activate
Range("D3").Select
ActiveSheet.Paste
End Sub
Please see screenshots below.