View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
amrezzat[_21_] amrezzat[_21_] is offline
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