VBA: Copying 5 columns in a group and pasting it to the subsequent 5 columns of the same sheet..

omairhe

Well-known Member
Joined
Mar 26, 2009
Messages
2,040
Office Version
  1. 2019
Platform
  1. Windows
Hello, How are the ms excel experts?

I wanted to ask of you a favour. Like the title suggests, a Vba that could copy the values from columns F, G, H, I and J and paste these as values into
columms K, L, M, N and O respectively. These Columns from F to O are Hidden. I'd like the code to copy from Row 5 til last data cell in column F.
So the data in this range consists of formulas which outputs numerical whole numbers that needs to be copied as values to the subsequent columns.
Rather simple, I am sure, for the excel gurus.

Will appreciate a lot.
 

Excel Facts

Move date out one month or year
Use =EDATE(A2,1) for one month later. Use EDATE(A2,12) for one year later.
Hi
Simply
Try
VBA Code:
Sub test()
    Dim a As Variant
    a = Cells(5, 6).Resize(Cells(Rows.Count, 6).End(xlUp).Row, 5).Value
    Cells(5, 6).Offset(, 5).Resize(UBound(a, 1), UBound(a, 2)) = a
End Sub
 
Upvote 0
Solution
Hi
Simply
Try
VBA Code:
Sub test()
    Dim a As Variant
    a = Cells(5, 6).Resize(Cells(Rows.Count, 6).End(xlUp).Row, 5).Value
    Cells(5, 6).Offset(, 5).Resize(UBound(a, 1), UBound(a, 2)) = a
End Sub
Thank you so much mohadin.
I really appreciate that.
 
Upvote 0

Forum statistics

Threads
1,213,561
Messages
6,114,312
Members
448,564
Latest member
ED38

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