Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 4
Default how do I copy every 2nd row

I have rows of information (mailing list). I would like to copy every 5th
row only to a new workbook using transpose without having to highlight every
5th entry. Is this possible?
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 52
Default how do I copy every 2nd row

Example

Destination workboook, Sheet1, A1...

=INDEX('[Source.xls]Sheet1'!$A$1:$A$100,5*(ROWS($A$1:A1)-1)+1)

which can be copied down.

Chris H wrote:
I have rows of information (mailing list). I would like to copy every 5th
row only to a new workbook using transpose without having to highlight every
5th entry. Is this possible?

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 22,906
Default how do I copy every 2nd row

2nd or 5th?

For 2nd as Subject line reads.

In a helper column adjacent to your data.

I'll use column M for example.

Leave M1 blank, enter x in M2, blank in M3, x in M4

Select M1:M4 and drag/copy down.

Autofilter on column M for x

F5SpecialVisible cellsOK

Copy then paste into new workbook.

Then do the copypaste specialtranspose.


Gord Dibben MS Excel MVP

On Sun, 15 Nov 2009 11:32:01 -0800, Chris H <Chris
wrote:

I have rows of information (mailing list). I would like to copy every 5th
row only to a new workbook using transpose without having to highlight every
5th entry. Is this possible?


  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 10,124
Default how do I copy every 2nd row

If desired, send your file to my address below. I will only look if:
1. You send a copy of this message on an inserted sheet
2. You give me the newsgroup and the subject line
3. You send a clear explanation of what you want
4. You send before/after examples and expected results.


--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"Chris H" <Chris
wrote in message
...
I have rows of information (mailing list). I would like to copy every 5th
row only to a new workbook using transpose without having to highlight
every
5th entry. Is this possible?


  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3,101
Default how do I copy every 2nd row

A macro will this for you
Option Explicit
Sub every5thRow()
Const WORKSHEET_NAME As String = "Sheet1"
Dim x As Long, i

x = 0
i = 1
Dim ws As Worksheet
Set ws = ThisWorkbook.Worksheets(WORKSHEET_NAME)

Dim rng As Range
Set rng = ws.Range(ws.Cells(1, "A"), ws.Cells(Rows.Count, "A").End(xlUp))

Dim arrnoedimensional() As Variant
ReDim arrnoedimensional(1 To rng.Cells.Count)

Dim Cell As Range
For Each Cell In rng
If i Mod 5 = 0 Then
x = x + 1
arrnoedimensional(x) = Cell.Value
End If
i = i + 1
Next

Workbooks.Add
Dim wb As Workbook
Set wb = ActiveWorkbook
ReDim Preserve arrnoedimensional(1 To x)

i = 2
Dim strValue As Variant
For Each strValue In arrnoedimensional
wb.Worksheets(1).Range("A" & i).Value = strValue
i = i + 1
Next

End Sub

"Chris H" wrote:

I have rows of information (mailing list). I would like to copy every 5th
row only to a new workbook using transpose without having to highlight every
5th entry. Is this possible?



  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3,101
Default how do I copy every 2nd row

Put this line above

If x = 0 Then Exit Sub ' Exit sub if no data
Workbooks.Add

"Chris H" wrote:

I have rows of information (mailing list). I would like to copy every 5th
row only to a new workbook using transpose without having to highlight every
5th entry. Is this possible?

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 and paste versus copy and insert copied cells Alana New Users to Excel 1 September 28th 07 08:58 PM
I copy a formula and the results copy from the original cell brooklynsd Excel Discussion (Misc queries) 1 June 23rd 07 01:35 AM
How do I copy formulas but using the same range each time I copy Laffin Excel Worksheet Functions 2 June 22nd 06 04:17 PM
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
EXCEL FILE a copy/a copy/a copy ....filename ve New Users to Excel 1 September 29th 05 09:12 PM


All times are GMT +1. The time now is 05:24 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"