+ Reply to Thread
Results 1 to 3 of 3

Run time error 13 with new Collection

  1. #1
    Tomkat743
    Guest

    Run time error 13 with new Collection

    Type Mismatch

    Stops on Line: "For Each itm In Collection" (says no itm no Collection.)

    Any thoughts? Please help
    Also why does VB put a space between row and column

    Dim bkList As New Collection
    With Workbooks("1DLSUNDAY.XLS").Worksheets("Master")
    Set rng = .Range(.Cells(2, 3), .Cells(2, 3).End(xlDown))
    End With

    On Error Resume Next
    For Each cell In rng
    bkList.Add Trim(cell.Text), Trim(cell.Text)
    Next
    On Error GoTo 0

    For Each itm In Collection
    Workbooks.Open "C:\Documents and Settings\Tom\Desktop\CHARTER BLANK\NEW
    BLANK\" & _
    itm & ".xls"
    Next

  2. #2
    JMB
    Guest

    RE: Run time error 13 with new Collection

    Maybe

    For Each itm In bkList

    "Tomkat743" wrote:

    > Type Mismatch
    >
    > Stops on Line: "For Each itm In Collection" (says no itm no Collection.)
    >
    > Any thoughts? Please help
    > Also why does VB put a space between row and column
    >
    > Dim bkList As New Collection
    > With Workbooks("1DLSUNDAY.XLS").Worksheets("Master")
    > Set rng = .Range(.Cells(2, 3), .Cells(2, 3).End(xlDown))
    > End With
    >
    > On Error Resume Next
    > For Each cell In rng
    > bkList.Add Trim(cell.Text), Trim(cell.Text)
    > Next
    > On Error GoTo 0
    >
    > For Each itm In Collection
    > Workbooks.Open "C:\Documents and Settings\Tom\Desktop\CHARTER BLANK\NEW
    > BLANK\" & _
    > itm & ".xls"
    > Next


  3. #3
    Tomkat743
    Guest

    RE: Run time error 13 with new Collection

    Thanks alot I just couldn't see it.

    "JMB" wrote:

    > Maybe
    >
    > For Each itm In bkList
    >
    > "Tomkat743" wrote:
    >
    > > Type Mismatch
    > >
    > > Stops on Line: "For Each itm In Collection" (says no itm no Collection.)
    > >
    > > Any thoughts? Please help
    > > Also why does VB put a space between row and column
    > >
    > > Dim bkList As New Collection
    > > With Workbooks("1DLSUNDAY.XLS").Worksheets("Master")
    > > Set rng = .Range(.Cells(2, 3), .Cells(2, 3).End(xlDown))
    > > End With
    > >
    > > On Error Resume Next
    > > For Each cell In rng
    > > bkList.Add Trim(cell.Text), Trim(cell.Text)
    > > Next
    > > On Error GoTo 0
    > >
    > > For Each itm In Collection
    > > Workbooks.Open "C:\Documents and Settings\Tom\Desktop\CHARTER BLANK\NEW
    > > BLANK\" & _
    > > itm & ".xls"
    > > Next


+ Reply to Thread

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.6.0 RC 1