Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Automatic Selection of Multiple Rows | Excel Worksheet Functions | |||
Looping a selection of rows | Excel Discussion (Misc queries) | |||
Get rows which match selection criteria | Excel Programming | |||
Cell selection with hidden rows | Excel Programming | |||
Selection.End(xlDown) with Rows selected | Excel Programming |