Forum Discussion
wass024
Feb 08, 2022Copper Contributor
Need to index every fifth column to a single column
Hi, I have four columns of data types that will repeat with a space between. They will all need to put into single columns on a different sheet, so column A should have column F under it, and column ...
JMB17
Feb 08, 2022Bronze Contributor
Assuming the data in your worksheet are constant values, and not formulas, then I believe this would work as well.
Sub CopyData()
Dim area As Range
Dim srcWksht As Worksheet
Dim destWksht As Worksheet
Set srcWksht = ActiveSheet
Set destWksht = Worksheets.Add(after:=srcWksht)
For Each area In srcWksht.UsedRange.SpecialCells(xlCellTypeConstants).Areas
area.Copy destWksht.Cells(destWksht.Rows.Count, 1).End(xlUp)(2, 1)
Next area
End Sub