Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 208
Default How to copy large block of cells but paste into one column

Hi

How can I take a large block of data (A1:Y300 which is 24 cols, 300 rows or
7200 cells of data) and paste that data into another sheet but only into one
column (so I get the 7200 data cells all in one column from say B1:B7200.

thank you!!

Craig


  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 896
Default How to copy large block of cells but paste into one column

Sub zalatw()
'just qiuck and dirty
'1. select yr range A1:Y300 first
'2. copy it and paste special with TRANSPOSE to another location
'3. Select the range you have pasted
'4. run the macro

Sheets("Sheet2").Columns(2).ClearContents

With ActiveSheet
For i = 0 To Selection.Columns.Count - 1
For j = 1 To Selection.Rows.Count
counter = counter + 1
Sheets("Sheet2").Cells(licznik, 2) = Selection.Cells(counter)
Next j
Next i

'Optional: 5. delete transposed range
'Selection..ClearContents

End With
End Sub


HIH
  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 896
Default How to copy large block of cells but paste into one column

oops

this one is better


Sub zalatw()
'just qiuck and dirty
'1. select yr range A1:Y300 first
'2. run the macro
'3. result will be inserted into Sheet2


Sheets("Sheet2").Cells.ClearContents

Selection.Copy
col = Selection.Columns.Count
roww = Selection.Rows.Count

Sheets("Sheet2").Range("D1").PasteSpecial Paste:=xlValues,
Transpose:=True

Sheets("Sheet2").Range(Range("D1"), Range("D1").Offset(col - 1, roww -
1)).Select

With Selection
For i = 0 To Selection.Columns.Count - 1
For j = 1 To Selection.Rows.Count
counter = counter + 1
Sheets("Sheet2").Cells(counter, 2) = Selection.Cells(counter)
Next j
Next i

Sheets("Sheet2").Range(Range("D1"), Range("D1").Offset(col - 1, roww -
1)).ClearContents

Application.CutCopyMode = False

End With
End Sub
  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 22,906
Default How to copy large block of cells but paste into one column

Craig

That would 25 cols and 300 rows for 7500 cells.

Sub ToOneColumn()
Dim cntI As Integer
Dim cntJ As Integer
Dim TotalRows As Integer
Dim TotalCols As Integer
With Range("A1:Y300")

TotalRows = .Rows.Count
TotalCols = .Columns.Count

End With

For cntJ = 2 To TotalCols

Cells(1, cntJ).Select
Range(Selection, Selection.End(xlDown)).Select
Selection.Cut
Cells((cntJ - 1) * TotalRows + 1, 1).Select
ActiveSheet.Paste

Next cntJ

Cells(1, 1).Select

End Sub


Gord Dibben MS Excel MVP

On Fri, 15 Aug 2008 06:14:01 -0700, Craig
wrote:

Hi

How can I take a large block of data (A1:Y300 which is 24 cols, 300 rows or
7200 cells of data) and paste that data into another sheet but only into one
column (so I get the 7200 data cells all in one column from say B1:B7200.

thank you!!

Craig


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
Copy & paste block of text number of times equal to value in cell azoll Excel Worksheet Functions 1 July 29th 08 06:03 AM
How to autosize/wrap large text block? Tim Johnson Excel Discussion (Misc queries) 1 October 19th 06 01:58 AM
Copy/Paste how to avoid the copy of formula cells w/o calc values Dennis Excel Discussion (Misc queries) 10 March 2nd 06 10:47 PM
copy a block of cells florin Excel Discussion (Misc queries) 2 October 12th 05 03:16 PM
How to copy block of cells and keep grouping? dstock Excel Discussion (Misc queries) 2 July 6th 05 08:42 PM


All times are GMT +1. The time now is 12:11 AM.

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"