Home |
Search |
Today's Posts |
#5
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Public Sub Snake3to9()
Dim myRange As Range Dim colsize As Long Dim maxrow As Long Const numgroup As Integer = 3 Const NumCols As Integer = 9 On Error GoTo fileerror colsize = Int((ActiveSheet.UsedRange.Rows.Count + _ ((NumCols - 1)) / NumCols)) / numgroup MsgBox "Number of Rows to Move is: " & colsize Range("A1").Select With ActiveCell.Parent.UsedRange maxrow = .Cells(.Cells.Count).Row + 1 End With ActiveCell.Parent.Cells(maxrow, ActiveCell.Column) _ .End(xlUp).Offset(1, 0).Select Set myRange = Range(ActiveCell.Address & ":" _ & ActiveCell.Offset(-colsize, (numgroup - 1)).Address) myRange.Cut Destination:=ActiveSheet.Range("A1").Offset(0, _ (NumCols - numgroup)) Range("A1").Select Cells.End(xlDown).Offset(1, 0).Select Set NextRange = Range(ActiveCell.Address & ":" _ & ActiveCell.Offset(-colsize, (numgroup - 1)).Address) NextRange.Cut Destination:=ActiveSheet.Range("A1").Offset(0, _ (NumCols / numgroup)) Application.CutCopyMode = False Range("A1").Select fileerror: End Sub Gord Dibben MS Excel MVP On Fri, 19 Feb 2010 07:13:01 -0800, jmcclain wrote: Sorry for the cryptic subject - wasn't sure how to explain. I have a spreadsheet comprising (3) columns and 41,000+ lines. I need to know if there is a easy way to reduce the page count vs cutting and pasting additional columns to the right. Any thoughts would be appreciated. Jon |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Create Pivot Table Data with Column "Sum" rather than "count" defa | Excel Discussion (Misc queries) | |||
is it possible to "merge" multiple worksheets into one worksheet? | Excel Discussion (Misc queries) | |||
Multiple "other" delimiters? Easy multiple cell merge? | Excel Discussion (Misc queries) | |||
How Might I "Mail Merge" Data For Multiple .txt File Output? | Excel Discussion (Misc queries) | |||
Count occurences of "1"/"0" (or"TRUE"/"FALSE") in a row w. conditions in the next | New Users to Excel |