Computing.Net > Forums > Office Software > Delete rows in Excel

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Click here to start participating now! Also, check out the New User Guide.

Delete rows in Excel

Reply to Message Icon

Name: RMJ
Date: January 22, 2004 at 13:24:56 Pacific
OS: Windows 200 Pro
CPU/Ram: Intel P4 512
Comment:

I have a series of worksheets, each containing approx 5000 rows of data. This data is ordered in four columns Chainage, Easting, Northing and Elevation.

The data is generated and dumped into excel as a mixture of measured coordinates, and interpolated coordinates, the latter being the more interesting.

I want to delete all rows of information if the first column (the chainage) is not a whole number.

Foe example:

row Chainage Easting Northing Elevation
1....1500........456....653......6
2....1509.203....457....654......5
3....1600........345....653......4
4....1601.23.....456....465......6

From the above example I would want to delete rows 2 and 4.

Can anyone suggest a macro / VBA routine for doing so?

Many thanks in advance

RMJ




Sponsored Link
Ads by Google

Response Number 1
Name: Positron
Date: January 22, 2004 at 22:23:14 Pacific
Reply:

I think a good solution would be adding the ASAP utilities to your EXCEL, if yoou goto:
http://www.asap-utilities.com/
And then in that site
List of tools>columns & rows> Conditional row and column select

you will find what you want.


0

Response Number 2
Name: hoi polloi
Date: January 23, 2004 at 05:09:45 Pacific
Reply:

I don't know if this is a one-off but if so you could do it manually.

Highlight the column, change the cell to Number and set the number of of decimal places to the maximum you need you need (eg 3 shown in you rexample).

The round figures should then show a decimal point with zeros after it.

You can then set up an IF function so any cell which has numbers greater than zero after the decimal point is assigned a word or letter in a new column.

Then highlight the whole sheet, got to Data - Sort, sort it by the column with the word or letter in so those rows are all bunched together, then highlight and delete those rows.



0

Response Number 3
Name: hoi polloi
Date: January 23, 2004 at 05:19:26 Pacific
Reply:

I was bit slow there. If you set them to display zeros you don't need to use a funtion because all the entries greater than zero wil bunch together anyway.

I just tried it.


0

Response Number 4
Name: dtech10
Date: January 23, 2004 at 17:02:33 Pacific
Reply:

Hi RMJ

Try something like this

Sub Macro3()
' This scans down column A1 to A24
' and delete those rows that are not integers

Dim x
For x = 1 To 24
If Cells(x, 1) <> Int(Cells(x, 1)) Then
Cells(x, 1).EntireRow.Delete
End If
Next
End Sub


0

Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More


msohelp.exe error on Word... Norton Disk Doctor error....



Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Office Software Forum Home


Sponsored links

Ads by Google


Results for: Delete rows in Excel

Excel VBA delete rows w/integers www.computing.net/answers/office/excel-vba-delete-rows-wintegers/9236.html

recover deleted sheet in Excel www.computing.net/answers/office/recover-deleted-sheet-in-excel/2020.html

increase no of rows in excel shet www.computing.net/answers/office/increase-no-of-rows-in-excel-shet/8272.html