Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2
Default Cutting and Pasting cells from horizontal to multi vertical column

Does anyone know of a function (regular or ASAP Util) thay will allow a
certain range of cells from one column to be cut and pasted across several
columns vertically. For example, I have 2000 cells in column "A" that needs
to be boken down into 18 cells per column pasted horizontally accross the
spreadsheet into other columns (i.e. B, C, D, etc.). Can any one help.
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 210
Default Cutting and Pasting cells from horizontal to multi vertical column

A function can only return a value, not copy and paste rows. Excel will fall
out of the function if you attempt to paste information into another cell.
--
http://HelpExcel.com




"Ms SDB" wrote:

Does anyone know of a function (regular or ASAP Util) thay will allow a
certain range of cells from one column to be cut and pasted across several
columns vertically. For example, I have 2000 cells in column "A" that needs
to be boken down into 18 cells per column pasted horizontally accross the
spreadsheet into other columns (i.e. B, C, D, etc.). Can any one help.

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 22,906
Default Cutting and Pasting cells from horizontal to multi vertical column

Do you want A19:A36 in B1:B18 and A37:A54 in C1:C18 ?

If your data is in column A starting at Cell A1, then the following
formula, entered in Cell B1 and filled across to column DI and down 18
rows will produce 110 columns of 18 rows plus 1 column of 2 rows. *Any more/less
than 2000 original rows, you do the math and make alterations.

=INDIRECT("A"&(ROW()+(COLUMN()-2)*18))

The 2 refers to the column of Cell B1; if you're putting the formula in
a different column, use the appropriate number for that column.

CopyPaste Special(in place) the results then delete the original column A.

Or you can use a macro................

Public Sub SplitToCols()
Dim NUMCOLS As Integer
Dim i As Integer
Dim colsize As Long
On Error GoTo fileerror

NUMCOLS = InputBox("Choose Final Number of Columns") '112 in this case
colsize = Int((ActiveSheet.UsedRange.Rows.Count + _
(NUMCOLS - 1)) / NUMCOLS)
For i = 2 To NUMCOLS
Cells((i - 1) * colsize + 1, 1).Resize(colsize, 1).Copy Cells(1, i)
Next i
Range(Cells(colsize + 1, 1), Cells(Rows.Count, 1)).Clear
fileerror:
End Sub


Gord Dibben MS Excel MVP


On Mon, 22 Jan 2007 09:04:01 -0800, Ms SDB
wrote:

Does anyone know of a function (regular or ASAP Util) thay will allow a
certain range of cells from one column to be cut and pasted across several
columns vertically. For example, I have 2000 cells in column "A" that needs
to be boken down into 18 cells per column pasted horizontally accross the
spreadsheet into other columns (i.e. B, C, D, etc.). Can any one help.


  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2
Default Cutting and Pasting cells from horizontal to multi vertical co

Thank you, thank you, thank you!! I would have never thought about the
"Indirect" function. Both the formula and the macro worked exactly like I
wanted it too.

"Gord Dibben" wrote:

Do you want A19:A36 in B1:B18 and A37:A54 in C1:C18 ?

If your data is in column A starting at Cell A1, then the following
formula, entered in Cell B1 and filled across to column DI and down 18
rows will produce 110 columns of 18 rows plus 1 column of 2 rows. Any more/less
than 2000 original rows, you do the math and make alterations.

=INDIRECT("A"&(ROW()+(COLUMN()-2)*18))

The 2 refers to the column of Cell B1; if you're putting the formula in
a different column, use the appropriate number for that column.

CopyPaste Special(in place) the results then delete the original column A.

Or you can use a macro................

Public Sub SplitToCols()
Dim NUMCOLS As Integer
Dim i As Integer
Dim colsize As Long
On Error GoTo fileerror

NUMCOLS = InputBox("Choose Final Number of Columns") '112 in this case
colsize = Int((ActiveSheet.UsedRange.Rows.Count + _
(NUMCOLS - 1)) / NUMCOLS)
For i = 2 To NUMCOLS
Cells((i - 1) * colsize + 1, 1).Resize(colsize, 1).Copy Cells(1, i)
Next i
Range(Cells(colsize + 1, 1), Cells(Rows.Count, 1)).Clear
fileerror:
End Sub


Gord Dibben MS Excel MVP


On Mon, 22 Jan 2007 09:04:01 -0800, Ms SDB
wrote:

Does anyone know of a function (regular or ASAP Util) thay will allow a
certain range of cells from one column to be cut and pasted across several
columns vertically. For example, I have 2000 cells in column "A" that needs
to be boken down into 18 cells per column pasted horizontally accross the
spreadsheet into other columns (i.e. B, C, D, etc.). Can any one help.



  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 22,906
Default Cutting and Pasting cells from horizontal to multi vertical co

Yay! I guessed correctly.

Thanks for the feedback.

On Mon, 22 Jan 2007 12:34:00 -0800, Ms SDB
wrote:

Thank you, thank you, thank you!! I would have never thought about the
"Indirect" function. Both the formula and the macro worked exactly like I
wanted it too.

"Gord Dibben" wrote:

Do you want A19:A36 in B1:B18 and A37:A54 in C1:C18 ?

If your data is in column A starting at Cell A1, then the following
formula, entered in Cell B1 and filled across to column DI and down 18
rows will produce 110 columns of 18 rows plus 1 column of 2 rows. Any more/less
than 2000 original rows, you do the math and make alterations.

=INDIRECT("A"&(ROW()+(COLUMN()-2)*18))

The 2 refers to the column of Cell B1; if you're putting the formula in
a different column, use the appropriate number for that column.

CopyPaste Special(in place) the results then delete the original column A.

Or you can use a macro................

Public Sub SplitToCols()
Dim NUMCOLS As Integer
Dim i As Integer
Dim colsize As Long
On Error GoTo fileerror

NUMCOLS = InputBox("Choose Final Number of Columns") '112 in this case
colsize = Int((ActiveSheet.UsedRange.Rows.Count + _
(NUMCOLS - 1)) / NUMCOLS)
For i = 2 To NUMCOLS
Cells((i - 1) * colsize + 1, 1).Resize(colsize, 1).Copy Cells(1, i)
Next i
Range(Cells(colsize + 1, 1), Cells(Rows.Count, 1)).Clear
fileerror:
End Sub


Gord Dibben MS Excel MVP


On Mon, 22 Jan 2007 09:04:01 -0800, Ms SDB
wrote:

Does anyone know of a function (regular or ASAP Util) thay will allow a
certain range of cells from one column to be cut and pasted across several
columns vertically. For example, I have 2000 cells in column "A" that needs
to be boken down into 18 cells per column pasted horizontally accross the
spreadsheet into other columns (i.e. B, C, D, etc.). Can any one help.






Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Cutting and pasting from rows into columns and visa versa. Pank New Users to Excel 2 November 8th 06 01:54 PM
how to get rid of hyperlinks when cutting and pasting e-mail addre Mike Nolan Excel Discussion (Misc queries) 3 June 15th 06 01:18 PM
protect sheets against cutting / pasting UllidIreland Excel Worksheet Functions 1 June 6th 06 05:39 PM
Setting up some sort of cutting and pasting loop Trickster Excel Worksheet Functions 4 July 20th 05 07:13 AM
when cutting and pasting to different files the year changes... w. excel Excel Worksheet Functions 1 April 13th 05 09:51 PM


All times are GMT +1. The time now is 04:58 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"