Copy whole column and paste to variable column

richardcdahlgren

Board Regular
Joined
Oct 16, 2008
Messages
81
I need to copy the Data from Column E to paste to column variable by stage number (shown in cell E4) + 7. So Stage 1 would paste to Column H, Stage 2 paste to column I, and so on. In addition, it needs to unhide that column before pasting. Any ideas how to do this?

Thanks in advance for any assistance on this.
 

Excel Facts

Links? Where??
If Excel says you have links but you can't find them, go to Formulas, Name Manager. Look for old links to dead workbooks & delete.
I need to copy the Data from Column E to paste to column variable by stage number (shown in cell E4) + 7. So Stage 1 would paste to Column H, Stage 2 paste to column I, and so on. In addition, it needs to unhide that column before pasting. Any ideas how to do this?

Thanks in advance for any assistance on this.

Try this

Code:
Sub test()
    Range("E5:E" & Range("E" & Rows.Count).End(xlUp).Row).Copy Cells(5, Range("E4").Value + 7)
End Sub
 
Upvote 0
Try this

Code:
Sub test()
    Range("E5:E" & Range("E" & Rows.Count).End(xlUp).Row).Copy Cells(5, Range("E4").Value + 7)
End Sub
A smidgeon more compact...

Range("E5", Cells(Rows.Count, "E").End(xlUp)).Copy Cells(5, Range("E4").Value + 7)

and, if the E4 reference is really fixed and unchanging...

Range("E5", Cells(Rows.Count, "E").End(xlUp)).Copy Cells(5, [E4+7])

Note: I know I could use 5 in place of "E" inside the Cells object call, but I prefer using letters for their self-documenting properties.
 
Last edited:
Upvote 0
A smidgeon more compact...


Note: I know I could use 5 in place of "E" inside the Cells object call, but I prefer using letters for their self-documenting properties.

Hi Rick, it had been a while without crossing.
What it means: "Smidgeon"
Thanks again for your contributions!
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,177
Members
453,021
Latest member
Justyna P

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