Hi Friends,
I got the following Coding from one of the forum. The coding is used to Split the Spreadsheet into Multiple Tables.
How to get the number of columns as user Input, and to split the spread sheet into multiple tables as per user input requirements.
Sub moveIt()
Dim rColA As Range, sMstr As Worksheet, sNew As Worksheet
Dim i As Integer, j As Integer
Dim lCol As Integer
Application.ScreenUpdating = False
Set sMstr = Sheets(1)
Set rColA = sMstr.Range("A1:A10")
lCol = sMstr.Cells(1, Columns.Count).End(xlToLeft).Column
For i = 2 To lCol Step 5
j = j + 1
Set sNew = Sheets.Add(after:=Sheets(Sheets.Count))
sNew.Name = "Output " & Format(j, "00")
rColA.Copy
sNew.Cells(1, 1).PasteSpecial xlPasteAll
Range(sMstr.Cells(1, i), sMstr.Cells(10, i + 4)).Copy Destination:=sNew.Cells(1, 2)
sNew.Cells.Columns.AutoFit
sNew.Range("a1").Select
Next
sMstr.Activate
sMstr.Range("a1").Select
Application.ScreenUpdating = True
End Sub
Thanks,
Rakesh
Bookmarks