Colin

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
 

Excel Facts

How can you turn a range sideways?
Copy the range. Select a blank cell. Right-click, Paste Special, then choose Transpose.

Forum statistics

Threads
1,223,264
Messages
6,171,081
Members
452,377
Latest member
bradfordsam

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top