Colin Kelly
New Member
- Joined
- Feb 13, 2012
- Messages
- 1
Control button coping when using VBA's column copy:
I have a sheet with regular sets of columns, and I need to be able to select my column groups and paste them at the end of my data, or within the middle of existing groups. I have the column copy/paste details in VBA sorted out, but now want to let the use select where to add or delete columns. One way of doing this is to use an input box to get the desired insertion point (eg a number that I can use to lookup the column index). However, another way which I need help on is to have a control button in the last column (row 1) of each "group" of columns, so that the user can just click this button to have groups added/deleted. I have determined that I can multiple control buttons all with the same name and assigned macro, and in the macro get the calling button's range to determine my column insert or delete point.
The problem I have is that when I copy/paste selected columns with VBA, the controls are not copied, and it's not obvious to me how to use VBA to do this.
Thanks for any help
I have a sheet with regular sets of columns, and I need to be able to select my column groups and paste them at the end of my data, or within the middle of existing groups. I have the column copy/paste details in VBA sorted out, but now want to let the use select where to add or delete columns. One way of doing this is to use an input box to get the desired insertion point (eg a number that I can use to lookup the column index). However, another way which I need help on is to have a control button in the last column (row 1) of each "group" of columns, so that the user can just click this button to have groups added/deleted. I have determined that I can multiple control buttons all with the same name and assigned macro, and in the macro get the calling button's range to determine my column insert or delete point.
The problem I have is that when I copy/paste selected columns with VBA, the controls are not copied, and it's not obvious to me how to use VBA to do this.
Thanks for any help