Cut and paste columns to the bottom of a different column with VB

lmoran89

New Member
Joined
Apr 9, 2019
Messages
12
Office Version
  1. 2013
Platform
  1. Windows
There is a monthly report run, where the number of columns are the same each month, but the amount of data (rows) is different

Columns A - AI are from the monthly report run
A and B are Key fields that will need to be copied to each group of columns
Beginning with column C, every 3 columns are a group (e.g.columns C-E)
Columns A-B need to be copied and inserted before each group of columns (e.g. before column F, then before the next group, which shifts, so it would be column L, and so on). I've got this working in VB

Then each column group, which is now 5 columns (A-E, F-J, etc) needs to be cut and pasted at the last row of data in columns A-E. Because the amount of data (rows) is different each month this is causing me trouble creating a script

Any assistance is appreciated
 

Excel Facts

Can Excel fill bagel flavors?
You can teach Excel a new custom list. Type the list in cells, File, Options, Advanced, Edit Custom Lists, Import, OK
Hello - need a bit more help, and again, did not provide all the information. Regarding the groups of columns, the last 4 columns in the original data set cannot get moved, they have different data. But one of the columns I was using that data as a constant (needed for grouping in a different program). I still need a constant in a column for all of the rows with data.

So, going back to @Joe4 's and his methodology thet column that has the constant is BE.

And @JackDanIce the column (without having inserted the columns) is AK

But it doesn't have to be that value, it can be anything, as long as it is a constant.

As always, your help is more than appreciated!

(One day I will learn this)
 
Upvote 0
I thought we established that after you inserted your columns, the new last column of data was BC?
If that is the case, we shouldn't be interfering with column BE.
 
Upvote 0
It was the last column of data needed to be moved. The script you provided is not moving those columns. The script provided by @JackDanIce did
 
Upvote 0
Then I am afraid I do not understand your new question. Based on the quotes below, it does not seem to make any sense to me.

That didn't seem quite right to me, so I doubled check, and if I insert two column after every block of three columns, I come up with column BC as the new last column.

You're correct. I was looking at an older file.

Regarding the groups of columns, the last 4 columns in the original data set cannot get moved, they have different data. But one of the columns I was using that data as a constant (needed for grouping in a different program). I still need a constant in a column for all of the rows with data.

So, going back to @Joe4 's and his methodology thet column that has the constant is BE

I cannot tell what you are after.
 
Upvote 0
A new column with a constant value. The value "Constant" in column F for every row

I hope that makes sense
 
Upvote 0
I hope that makes sense
Unfortunately, not so much. Remember, while you know exactly what the problem is, and have all the data in front of you, all that we have to go on is whatever you give us.
So please be as detailed as possible in your explanations. Providing actual examples is often helpful. There is a tool here you can use to post images of your data: XL2BB - Excel Range to BBCode
Walking us through an actual example may help clarify things.
 
Upvote 0

Forum statistics

Threads
1,215,523
Messages
6,125,317
Members
449,218
Latest member
Excel Master

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