Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / General Excel Questions / December 2007

Tip: Looking for answers? Try searching our database.

selecting every other line in excel

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
mskydriver@gmail.com - 24 Dec 2007 03:31 GMT
Does anyone know how to select every other line in excel?  I am not
talking about highlighting it but actually selecting it so I can copy
it over to another column.  What is happening is that I use some
specialized scientific equipment and it spits out lots of numbers on
top of one another the top is the x-axis and the bottom is the y-axis
and they are just alternating back and forth until it is done.  I
usually get over 2000 data points and I would like to graph this
without pressing control to select over a 1000 points.
Thank you for your support and help.
Max - 24 Dec 2007 03:55 GMT
One way ..
Assuming your source data is running in A1 down
Put in B1:
=INDEX($A:$A,ROWS($1:1)*2-2+COLUMNS($A:A))
Copy B1 to C1, fill down as far as required to exhaust the data in col A
(until zeros appear)
Signature

Max
Singapore
http://savefile.com/projects/236895
xdemechanik
---

> Does anyone know how to select every other line in excel?  I am not
> talking about highlighting it but actually selecting it so I can copy
[quoted text clipped - 5 lines]
> without pressing control to select over a 1000 points.
> Thank you for your support and help.
Rick Rothstein (MVP - VB) - 24 Dec 2007 04:21 GMT
Assuming your data is in Column "A" and starting in A1, is your ultimate
goal to put the contents of A2 into B1 and so on down the column? Here is a
macro that will copy the alternate data in Column A (changeable with the
code) to the Column B of the preceding row and then delete this alternate
data row. Your data can start in either Row 1 or Row 2, but there must be an
even number of rows with data (because these are paired numbers). Anyway,
try the macro out on some sample data to see if it does what you are looking
for.

Sub XY()
 Const Col As String = "B"
 Dim X As Long
 Dim FirstRow As Long
 Dim LastRow As Long
 LastRow = Cells(Rows.Count, Col).End(xlUp).Row
 FirstRow = 1 - (LastRow Mod 2 = 1)
 For X = LastRow To FirstRow + 1 Step -2
   Cells(X, Col).Offset(-1, 1).Value = Cells(X, Col).Value
   Cells(X, Col).EntireRow.Delete
 Next
End Sub

Rick

> Does anyone know how to select every other line in excel?  I am not
> talking about highlighting it but actually selecting it so I can copy
[quoted text clipped - 5 lines]
> without pressing control to select over a 1000 points.
> Thank you for your support and help.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.