View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Bokazoit Bokazoit is offline
external usenet poster
 
Posts: 1
Default Can't make this VB work plz assist :p


The code below should copy the the first row in range *a*, if the number
in the coloumn 6 in range a is greater than zero, and then paste that
row into the first row in range *b*. If not above 0 it should do
nothing...for now

I'm not so strong in vb, but under constant training hope You will
help


Code:
--------------------
Dim a() As Variant, b() As Variant

Range("A57:H66").Select
Selection.Copy
Range("A70:H79").PasteSpecial (xlPasteValuesAndNumberFormats)
Application.CutCopyMode = False
Selection.Sort Key1:=Range("F71"), Order1:=xlDescending, Header:=xlGuess _
, OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom, _
DataOption1:=xlSortNormal
a = Range("A70:H79")
b = Range("A83:H92")
For i = 1 To 10
If a(i + 1, 6) 0 Then
For ii = 1 To 8
b(i + 1, ii) = a(i + 1, ii)
Exit For
End If
Next
End Sub

--------------------


In advance tx :)


--
Bokazoit
------------------------------------------------------------------------
Bokazoit's Profile: http://www.excelforum.com/member.php...o&userid=11643
View this thread: http://www.excelforum.com/showthread...hreadid=467802