Results 1 to 15 of 15

Macro stopped working.

Threaded View

joleen Macro stopped working. 06-04-2011, 07:14 AM
snb Re: Macro stopped working. 06-04-2011, 07:23 AM
joleen Re: Macro stopped working. 06-04-2011, 08:51 AM
teylyn Re: Macro stopped working. 06-04-2011, 07:24 AM
joleen Re: Macro stopped working. 06-04-2011, 08:46 AM
snb Re: Macro stopped working. 06-04-2011, 08:53 AM
teylyn Re: Macro stopped working. 06-04-2011, 09:06 AM
joleen Re: Macro stopped working. 06-04-2011, 09:16 AM
snb Re: Macro stopped working. 06-04-2011, 09:41 AM
joleen Re: Macro stopped working. 06-05-2011, 05:39 AM
royUK Re: Macro stopped working. 06-05-2011, 05:47 AM
joleen Re: Macro stopped working. 06-05-2011, 06:16 AM
royUK Re: Macro stopped working. 06-05-2011, 01:13 PM
joleen Re: Macro stopped working. 06-06-2011, 05:05 AM
royUK Re: Macro stopped working. 06-06-2011, 05:37 AM
  1. #1
    Registered User
    Join Date
    06-04-2011
    Location
    California
    MS-Off Ver
    Excel 2007
    Posts
    7

    Macro stopped working.

    Hi,

    I am using this macro to print selected sheets from a workbook with 229 sheets.
    It should only print the sheets with qualifying data in two specific cells. It worked perfectly for about 2 weeks. I went home on Tuesday and everything was fine, came back on Thursday and I am getting a runtime 13 miss match error.

    Any thoughts?

    Sub macroprint()
    Dim Sh As Worksheet
        Dim Arr() As String
        Dim N As Integer
        N = 0
        For Each Sh In ActiveWorkbook.Worksheets
            If Sh.Visible = xlSheetVisible And Sh.Range("E1").Value > "40544" And Sh.Range("C2").Value <> "Occupied" Then
                N = N + 1
                ReDim Preserve Arr(1 To N)
                Arr(N) = Sh.Name
            End If
        Next
        If N = 0 Then
            MsgBox "No Vacant Dirty", vbExclamation
            Exit Sub
        End If
        With ActiveWorkbook
            .Worksheets(Arr).PrintOut
          
        End With
        
        End Sub
    Thank you
    Last edited by joleen; 06-05-2011 at 06:27 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