ok I can get it to do everything I need except copy the entire column. It just copies the header into the first column after the last column of data. also i can't get it to delete the original "volume" column.
Sub VolumeMove()
Dim ws As Worksheet
Dim last_column As Integer
Dim targetcol As Integer
Dim curCol As Integer
For Each ws In ActiveWorkbook.Worksheets
'last_column = ws.Cells.find("*", [A1], , , xlByColumns, xlPrevious).Column
With ws
last_column = ws.Cells(1, .Columns.Count).End(xlToLeft).Column
On Error Resume Next 'Will continue if an error results
For iloop = 1 To last_column
curCol = Column + last_column
If InStr(1, ws.Cells(1, iloop), "Volume", vbTextCompare) <> 0 Then
.Columns(curCol).Copy
End If
targetcol = last_column + 1
With ws.Columns(targetcol)
ws.Columns(targetcol).Select
Selection.PasteSpecial xlPasteAll
ws.Cells(1, targetcol).Value = "Total Volume"
End With
If InStr(1, ws.Cells(1, iloop), "Volume", vbTextCompare) <> 0 Then
.Columns(curCol).delete xlToLeft
End If
Next iloop
End With
Next ws
End Sub
Bookmarks