Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 492
Default Selection of Rows

Hi,
I import a fairly large amount of data into Excel (2500 rows or so) each
day from an ancient system, I'm not even really sure what the system is.
I've got the hang of Data to Columns, TRIM, etc to convert the data into a
form that can be manipulated in Excel.
What I need to do is to select the entire rows 2:3,5:6,8:9 and so on as they
usually (but not always) contain superfluous data so I can check the
contents before deleting them. That is to say, Don't select row one but do
select rows two and three, Don't select row four but do select rows five and
six and so on down a range of around 3000 rows.
I've tried without success to write a macro to do this as the large range
makes manual selection very tedious. Can anyone please offer me any advice?
All help gratefully received!
Thanks,
Alan.


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,441
Default Selection of Rows

Alan,

Sub AlanSelect()
Dim i As Long
Dim RowCount As Long
Dim mySelect As Range

RowCount = Range("A1").SpecialCells(xlCellTypeLastCell).Row

Set mySelect = Range("2:3")

For i = 5 To RowCount Step 3
Set mySelect = Union(mySelect, Range(i & ":" & i + 1))
Next i

mySelect.Select
End Sub

HTH,
Bernie
MS Excel MVP

"Alan" wrote in message
...
Hi,
I import a fairly large amount of data into Excel (2500 rows or so)

each
day from an ancient system, I'm not even really sure what the system is.
I've got the hang of Data to Columns, TRIM, etc to convert the data into a
form that can be manipulated in Excel.
What I need to do is to select the entire rows 2:3,5:6,8:9 and so on as

they
usually (but not always) contain superfluous data so I can check the
contents before deleting them. That is to say, Don't select row one but do
select rows two and three, Don't select row four but do select rows five

and
six and so on down a range of around 3000 rows.
I've tried without success to write a macro to do this as the large

range
makes manual selection very tedious. Can anyone please offer me any

advice?
All help gratefully received!
Thanks,
Alan.




  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 492
Default Selection of Rows

Bernie,
That's wonderful, absolutely perfect,
Thank You So Much!!
Alan.
"Bernie Deitrick" <deitbe @ consumer dot org wrote in message
...
Alan,

Sub AlanSelect()
Dim i As Long
Dim RowCount As Long
Dim mySelect As Range

RowCount = Range("A1").SpecialCells(xlCellTypeLastCell).Row

Set mySelect = Range("2:3")

For i = 5 To RowCount Step 3
Set mySelect = Union(mySelect, Range(i & ":" & i + 1))
Next i

mySelect.Select
End Sub

HTH,
Bernie
MS Excel MVP

"Alan" wrote in message
...
Hi,
I import a fairly large amount of data into Excel (2500 rows or so)

each
day from an ancient system, I'm not even really sure what the system

is.
I've got the hang of Data to Columns, TRIM, etc to convert the data into

a
form that can be manipulated in Excel.
What I need to do is to select the entire rows 2:3,5:6,8:9 and so on as

they
usually (but not always) contain superfluous data so I can check the
contents before deleting them. That is to say, Don't select row one but

do
select rows two and three, Don't select row four but do select rows five

and
six and so on down a range of around 3000 rows.
I've tried without success to write a macro to do this as the large

range
makes manual selection very tedious. Can anyone please offer me any

advice?
All help gratefully received!
Thanks,
Alan.






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
Automatic Selection of Multiple Rows Emmlie Excel Worksheet Functions 3 August 7th 08 06:43 PM
Looping a selection of rows Andre Kruger Excel Discussion (Misc queries) 1 December 15th 05 04:18 PM
Get rows which match selection criteria Fred Smith Excel Programming 1 February 21st 04 03:52 AM
Cell selection with hidden rows Andrew[_24_] Excel Programming 2 September 30th 03 05:33 PM
Selection.End(xlDown) with Rows selected norman Excel Programming 0 August 19th 03 01:45 AM


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

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

About Us

"It's about Microsoft Excel"