Results 1 to 6 of 6

(solved)Subscript out of range

Threaded View

  1. #1
    Registered User
    Join Date
    08-17-2011
    Location
    Denmark
    MS-Off Ver
    Excel 2010
    Posts
    8

    (solved)Subscript out of range

    Hi

    I get an error when i try to run this script/macro
    Public Sub Stat()
    
    Dim X As Range, Y As Range
    Dim A As Variant, B As Variant, C As Variant, D As Variant, E As Variant, F As Variant
    
    For Each X In Workbooks("stat3_syd_q1.csv").Worksheets("stat3_syd_q1").Range("B1", "B65536")
        If Not X.Offset(0, 3).Value = "" Then
            If Not X.Value = "Kommunenr." Then
                For Each Y In Workbooks("stat3_SYD07.csv").Worksheets("stat3_SYD07").Range("B1", "B65536")
    when i debug it marks the line that starts with For each
    i checked to make sure the filename was spelled correct
    Anything ive forgotten?

    Solved: Error is caused by file not found
    Last edited by Genzo; 08-17-2011 at 08:40 AM. Reason: solved

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