Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default rearrange numerical data with eliminating -1 and 0


hi to all

i have the next column

-1
0
1
2
3
4
5

and continues up to about 300 entry
how can i eleminate the -1 and 0 numbers and rearrange the data again
in the same column

thx in adavnce


--
amrezzat
------------------------------------------------------------------------
amrezzat's Profile: http://www.excelforum.com/member.php...o&userid=28766
View this thread: http://www.excelforum.com/showthread...hreadid=521685

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 53
Default rearrange numerical data with eliminating -1 and 0

Hi, try this:

Sub Row_Deleting()
Row = 1
Do Until Cells(Row, 1) = ""
Value = Cells(Row, 1)
If Value = "-1" Or Value = "0" Then GoTo line1 Else GoTo line2
line1:
Rows("" & Row & ":" & Row & "").Select
Selection.Delete Shift:=xlUp
GoTo line3
line2:
Row = Row + 1
line3:
Loop
End Sub


€žamrezzat" napĂ*sal (napĂ*sala):


hi to all

i have the next column

-1
0
1
2
3
4
5

and continues up to about 300 entry
how can i eleminate the -1 and 0 numbers and rearrange the data again
in the same column

thx in adavnce


--
amrezzat
------------------------------------------------------------------------
amrezzat's Profile: http://www.excelforum.com/member.php...o&userid=28766
View this thread: http://www.excelforum.com/showthread...hreadid=521685


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default rearrange numerical data with eliminating -1 and 0


now you make me delete the complete row
and i updated it to delete the only cell in the column which contains
-1 or 0
but when i delete it
any other cell have a reference to it make an error #ref
like the follwoing


a b
1 -1 =a1=-1
2 0 =a2=0
3 1 =a3=1
4 2 =a4=2
5 3 =a5=3

but after i delete it by that code
----------------------------------------
row = 4
Do Until Cells(row, "a") = ""
value = Cells(row, "a")
If value < 1 Then GoTo line1 Else GoTo line2
line1:

Cells(row, "a").Select
'Rows("" & Row & ":" & Row & "").Select

Selection.Delete Shift:=xlUp
GoTo line3
line2:
row = row + 1
line3:
Loop
--------------------------------------------------

a b
1 1 #ref
2 2 #ref
3 3 1
4 2
5 3


how to fix that error

and make the b column be well referenced and show 1
2
3


--
amrezzat
------------------------------------------------------------------------
amrezzat's Profile: http://www.excelforum.com/member.php...o&userid=28766
View this thread: http://www.excelforum.com/showthread...hreadid=521685

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 53
Default rearrange numerical data with eliminating -1 and 0

Hi, You didn't say that you want to delete only the cells. But try this - it
is deleting only the cells not rows (in my code it is the first column)

Sub Cells_Deleting()
Row = 1
Do Until Cells(Row, 1) = ""
Value = Cells(Row, 1)
If Value = "-1" Or Value = "0" Then GoTo line1 Else GoTo line2
line1:
Cells(Row, 1).Select
Selection.Delete Shift:=xlUp
GoTo line3
line2:
Row = Row + 1
line3:
Loop
End Sub




"amrezzat" wrote:


now you make me delete the complete row
and i updated it to delete the only cell in the column which contains
-1 or 0
but when i delete it
any other cell have a reference to it make an error #ref
like the follwoing


a b
1 -1 =a1=-1
2 0 =a2=0
3 1 =a3=1
4 2 =a4=2
5 3 =a5=3

but after i delete it by that code
----------------------------------------
row = 4
Do Until Cells(row, "a") = ""
value = Cells(row, "a")
If value < 1 Then GoTo line1 Else GoTo line2
line1:

Cells(row, "a").Select
'Rows("" & Row & ":" & Row & "").Select

Selection.Delete Shift:=xlUp
GoTo line3
line2:
row = row + 1
line3:
Loop
--------------------------------------------------

a b
1 1 #ref
2 2 #ref
3 3 1
4 2
5 3


how to fix that error

and make the b column be well referenced and show 1
2
3


--
amrezzat
------------------------------------------------------------------------
amrezzat's Profile: http://www.excelforum.com/member.php...o&userid=28766
View this thread: http://www.excelforum.com/showthread...hreadid=521685


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
rearrange data chartasap Excel Discussion (Misc queries) 4 May 1st 06 04:44 PM
help me on rearrange cells based on its numerical values without repeating any number amrezzat[_14_] Excel Programming 3 November 22nd 05 05:20 PM
help me on rearrange cells based on its numerical values without repeating any number amrezzat Excel Worksheet Functions 0 November 21st 05 11:01 PM
How to rearrange data Michel Rousseau Excel Programming 5 September 25th 04 03:37 AM
how to rearrange data Michel Rousseau Excel Programming 1 September 18th 04 11:09 PM


All times are GMT +1. The time now is 11:43 AM.

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"