hey guys,
i'm using a macro that opens and edit a report text file, when it gets to the part where it must decompose cells it displays "runtime error 9".
plz help
here are below two attached files (macro/report file)
regards
Last edited by mehdoush; 06-30-2009 at 05:46 PM. Reason: decompose, runtime error 9, cells
here's the decompose code
help plzCode:Sub decompose() 'decompose Dim Rnng As Range, Dn As Range, oVal, oSp As Long Dim Ray, cc As Long Set Rnng = Range(Range("B3"), Range("B" & Rows.Count).End(xlUp)) ReDim Ray(1 To Rnng.Count * 4, 1 To 4) For Each Dn In Rnng oVal = Split(Dn.Offset(, 3), "/") If UBound(oVal) > 0 Then For oSp = 0 To UBound(oVal) cc = cc + 1 Ray(cc, 1) = Dn Ray(cc, 2) = Dn.Offset(, 1) Ray(cc, 3) = Dn.Offset(, 2) Ray(cc, 4) = oVal(oSp) Next oSp Else cc = cc + 1 Ray(cc, 1) = Dn Ray(cc, 2) = Dn.Offset(, 1) Ray(cc, 3) = Dn.Offset(, 2) Ray(cc, 4) = Dn.Offset(, 3) End If Next Dn Range("B3").Resize(cc, 4).Value = Ray 'supprimer les lignes blank 'For i = Cells(Rows.Count, "D").End(xlUp).Row To 1 Step -1 'If IsEmpty(Cells(i, "D")) Then Rows(i).EntireRow.Delete 'Next i End Sub
any help plz ???
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks