A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Excel » General Discussion
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Non number cells



 
 
Thread Tools Display Modes
  #1  
Old August 5th, 2004, 08:22 PM
external usenet poster
 
Posts: n/a
Default Non number cells

Hello,

I'm currently using the following Macro:

===============================================

Dim rng As Range
Dim lastrow As Long
Dim row_index As Long

lastrow = ActiveSheet.Cells(Rows.Count, 1).End(x1Up).Row
For row_index = lastrow - 1 Step -1
If Not IsNumeric(Cells(row_index, 1).Value) Then
Rows (row_index).delete
End IF
Next

===============================================

This will remove any row when a Cell in column "A" is
anyhting else than a number.

What do I need to add if, after doing this first Macro, I
would like to do the same thing but the Cells in
column "C"???

Thanks!!!
  #2  
Old August 5th, 2004, 08:56 PM
jeff
external usenet poster
 
Posts: n/a
Default Non number cells

Hi,

This will look in col C and delete the row

change IsNumeric(Cells(row_index, 1).Value)
to IsNumeric(Cells(row_index, 3).Value)

jeff
-----Original Message-----
Hello,

I'm currently using the following Macro:

===============================================

Dim rng As Range
Dim lastrow As Long
Dim row_index As Long

lastrow = ActiveSheet.Cells(Rows.Count, 1).End(x1Up).Row
For row_index = lastrow - 1 Step -1
If Not IsNumeric(Cells(row_index, 1).Value) Then
Rows (row_index).delete
End IF
Next

===============================================

This will remove any row when a Cell in column "A" is
anyhting else than a number.

What do I need to add if, after doing this first Macro,

I
would like to do the same thing but the Cells in
column "C"???

Thanks!!!
.

  #3  
Old August 5th, 2004, 09:25 PM
external usenet poster
 
Posts: n/a
Default Non number cells

Hi,

Thanks for the answer!!!

Will this also delete rows in which the cell in
column "C" is empty???

Thanks!!!
-----Original Message-----
Hi,

This will look in col C and delete the row

change IsNumeric(Cells(row_index, 1).Value)
to IsNumeric(Cells(row_index, 3).Value)

jeff
-----Original Message-----
Hello,

I'm currently using the following Macro:

============================================== =

Dim rng As Range
Dim lastrow As Long
Dim row_index As Long

lastrow = ActiveSheet.Cells(Rows.Count, 1).End(x1Up).Row
For row_index = lastrow - 1 Step -1
If Not IsNumeric(Cells(row_index, 1).Value) Then
Rows (row_index).delete
End IF
Next

============================================== =

This will remove any row when a Cell in column "A" is
anyhting else than a number.

What do I need to add if, after doing this first Macro,

I
would like to do the same thing but the Cells in
column "C"???

Thanks!!!
.

.

 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
make a function that add number 1 in another number Manos Worksheet Functions 3 February 3rd, 2004 01:37 PM
count the number of cells that have a particular fill colour? Martin Y Worksheet Functions 4 October 27th, 2003 04:45 AM


All times are GMT +1. The time now is 06:12 PM.


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