copying data to next available empty columns

themole

Board Regular
Joined
Oct 26, 2009
Messages
96
hi,

sorry if this has been covered before.

i have a table of names (75 in total) and values, every week the values will change on the table. What i am after is a code so that once i click on the control button it will automatically copy and paste the list of names and corresponding values into next available empty columns in spreadsheet.

original list of names range from A4:A78 and values B4:B78. ideally would like to start copying data into columns D:E, leave column F blank then once control button clicked again to start copying into columns G:H, leave column I blank, and so on

hope this sounds straight forward,

cheers
 
hi,

after a little minor tweek to the code please. the cells in columns A:E contain formulas. The code is copying the formulas across into other columns, what i would like is if it would just copy the cell values,

thanks
 
Upvote 0

Excel Facts

What is the fastest way to copy a formula?
If A2:A50000 contain data. Enter a formula in B2. Select B2. Double-click the Fill Handle and Excel will shoot the formula down to B50000.
Code:
Sub v()
Dim rng As Range
Set rng = Intersect([A:E], Range([A1], ActiveSheet.UsedRange))
Cells(1, rng.Columns.Count + 3).Resize(rng.Rows.Count, 5) = rng.Value
End Sub
 
Upvote 0

Forum statistics

Threads
1,223,903
Messages
6,175,289
Members
452,631
Latest member
a_potato

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