Hi EMoe
Try this, please.
Option Explicit
'----------------------------------------------------------
' Procedure : Sheet1ToSheet2FlipColumns
' Date : 20060611
' Author : Joergen Bondesen
' Modifyed by :
' Purpose : Copy Sheet 1 to Sheet 2 and flip columns
' on sheet 2
' Note : Formula will be converted to Fixed value.
'----------------------------------------------------------
'
Sub Sheet1ToSheet2FlipColumns()
Dim x As Long
Dim WS1 As Worksheet
Dim WS2 As Worksheet
Dim cell As Range
Application.ScreenUpdating = False
Set WS1 = Worksheets("Sheet1") 'From
Set WS2 = Worksheets("Sheet2") 'To
With WS2
.Cells.Clear
WS1.UsedRange.Copy _
Destination:=.Range("A1")
.Rows("1:1").Insert Shift:=xlDown
For x = 1 To .UsedRange.Columns.Count
.Cells(1, x).Value = .Cells(1, x).Column
Next x
'// Formula 2 Fixec value
For Each cell In .Cells.SpecialCells _
(xlCellTypeFormulas, 23)
cell.Value = cell.Value
Next cell
'// Sort
.UsedRange.Sort _
Key1:=.Range("A1"), _
Order1:=xlDescending, Header:=xlNo, _
OrderCustom:=1, MatchCase:=False, _
Orientation:=xlLeftToRight, _
DataOption1:=xlSortNormal
.Rows("1:1").Delete Shift:=xlUp
End With
Set WS1 = Nothing
Set WS2 = Nothing
End Sub
--
Best Regards
Joergen Bondesen
"EMoe" wrote in message
...
Hello!
Is it there a VBA code that can grab all the data from the last column
on sheet 1, then paste it starting with the first or second column on
sheet 2. Go back to sheet 1and get the next to last column then past it
on the next column on sheet 2.
Thanks,
EMoe
--
EMoe
------------------------------------------------------------------------
EMoe's Profile:
http://www.excelforum.com/member.php...o&userid=23183
View this thread: http://www.excelforum.com/showthread...hreadid=550815