Olavfinnerud
New Member
- Joined
- Jun 7, 2022
- Messages
- 16
- Office Version
- 2021
- Platform
- Windows
Hi,
I have made a table which is for writing hours at work. I recorded a macro where i copied the C6:C17 range and pasted it one to the rigth (D6:D17). I then assigned the macro to the button so when i press it, it adds another column to the table. The problem is that this only works the first time i press the button. I need help to make the button add a column each time i press it, (to the rigth). So when i press it the second time it should add the same column to E6:E17 and the third time F6:F17 etc. I have uploaded a picture of the sheet and the code i have is:
Sub Macro2()
Range("C6:C17").Select
Selection.Copy
Range("D6").Select
ActiveSheet.Paste
ActiveSheet.Paste
Application.CutCopyMode = False
End Sub
Thank you in advanced
I have made a table which is for writing hours at work. I recorded a macro where i copied the C6:C17 range and pasted it one to the rigth (D6:D17). I then assigned the macro to the button so when i press it, it adds another column to the table. The problem is that this only works the first time i press the button. I need help to make the button add a column each time i press it, (to the rigth). So when i press it the second time it should add the same column to E6:E17 and the third time F6:F17 etc. I have uploaded a picture of the sheet and the code i have is:
Sub Macro2()
Range("C6:C17").Select
Selection.Copy
Range("D6").Select
ActiveSheet.Paste
ActiveSheet.Paste
Application.CutCopyMode = False
End Sub
Thank you in advanced