Search : in
By :

Macro for deleting row with condition

Last answer on Nov 11, 2009 9:54:02 am GMT deepak, on Feb 10, 2009 4:40:10 am GMT 
 Report this message to moderators

Hello,

suppose i have one column in which there are 24 rows i.e. A1:A24 and these rows contain some value

I need to make one macro in which i want to delete rows which have value greater than 5

Configuration: Windows Vista
Internet Explorer 7.0

Best answers for « macro for deleting row with condition » in :
Delete duplicates in an Excel column ShowDelete duplicates in an Excel column To remove duplicates in an Excel column: Click on the Data menu Filter Advanced Filter In this menu, select the column where the duplicates Check the box "Extract without duplication"...
Excel – Macro to detect and hide blank rows ShowExcel – Macro to detect and hide blank rows Issue Solution Note Issue I want a macro to unhide about 20 blank rows copy values into the top row then hide the remaining rows (some cells have fill though) then the next time it will...
[MySQL]Delete duplicates in a table Show[MySQL]Delete duplicates in a table To remove duplicates in a table set up as follows: CREATE TABLE IF NOT EXISTS TabTest ( prim_key integer(4) NOT NULL auto_increment, x integer, y integer, ...
Spreadsheets - Conditional expressions ShowWhat is a Conditional Structure? Conditional structures are instructions that allow to test if a condition is true or not. Conditional structures may be associated together. To successfully execute these tests using logical functions, spreadsheets...
General Terms and Conditions of Use ShowAll Rights Reserved - 2009 - Communitic International Object These General Terms and Conditions are meant to define the ways in which the services of the website en.kioskea.net, hereafter "The Service," are made available, as well as the...

1

provock, on Feb 10, 2009 6:57:41 am GMT
  • +3

I'm not very fnd of creating macro or VBA stuffs, but if you want a good example of a macro use to delete rows , just copy and paste this link in the address bar of your browser :http://support.microsoft.com/kb/213610

Reply to provock

2

Helper, on Feb 10, 2009 10:06:32 am GMT
  • +3

Private Sub Delete()


Dim intRow
Dim intLastRow
intLastRow = Range("A65536").End(xlUp).Row


For intRow = intLastRow To 1 Step -1

Rows(intRow).Select
If Cells(intRow, 1).Value > 5 Then
Cells(intRow, 1).Select
Selection.EntireRow.Delete

End If

Next intRow

Range("A1").Select


End Sub

The macro above will not delete blank rows. If you need to delete blank rows also in the range then use this.

Private Sub Delete()


Dim intRow
Dim intLastRow
intLastRow = Range("A65536").End(xlUp).Row


For intRow = intLastRow To 1 Step -1

Rows(intRow).Select
If Cells(intRow, 1).Value > 5 Or Cells(intRow, 1) = "" Then
Cells(intRow, 1).Select
Selection.EntireRow.Delete

End If

Next intRow

Range("A1").Select


End Sub

Reply to Helper

3

husssaid, on Mar 11, 2009 9:57:57 am GMT
  • +12

I have pasted table with some other information not in the table , needs to delete rows that the fourth column does not contain an number

Reply to husssaid

4

hero85, on Mar 16, 2009 3:09:40 pm GMT

Do you do small macro work for small money?

Reply to hero85

5

critenlee, on Aug 22, 2009 12:43:15 am BST

Thanks so much for sharing the post.




[url=http://sonneriegratuite.org/][color=#FFFFFF][u]gratuit pour mobile sonnerie portable mp3/u/color/url[color=#FFFFFF] - Sonnerie portable MP3 est en effet un pouvoir de l'innovation technologique. Ętes-vous familier avec cette sonnerie portable?/color[url=http://sonneriegratuite.org/][color=#FFF­FFF][u]gratuit pour mobile sonnerie portable mp3/u/color/url

Reply to critenlee

6

 arunv.cse@gmail.com, on Nov 11, 2009 9:54:02 am GMT
  • +1

Hi,,,,,i want to delete the empty column but,,having values in header.... that is in a1 cell...how to delete the entire column....also the heading...
.....

Reply to arunv.cse@gmail.com