+ Reply to Thread
Results 1 to 3 of 3
  1. #1
    Registered User
    Join Date
    02-20-2009
    Location
    La, CA
    MS-Off Ver
    Excel 2003
    Posts
    70

    Runtime error 9 opening and editing macro

    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
    Attached Files Attached Files
    Last edited by mehdoush; 06-30-2009 at 05:46 PM. Reason: decompose, runtime error 9, cells

  2. #2
    Registered User
    Join Date
    02-20-2009
    Location
    La, CA
    MS-Off Ver
    Excel 2003
    Posts
    70

    Re: Runtime error 9 opening and editing macro

    here's the decompose code

    Code:
    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
    help plz

  3. #3
    Registered User
    Join Date
    02-20-2009
    Location
    La, CA
    MS-Off Ver
    Excel 2003
    Posts
    70

    Re: Runtime error 9 opening and editing macro

    any help plz ???

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.2.0