+ Reply to Thread
Results 1 to 3 of 3

Summary sheet to create multiple worksheets

Hybrid View

  1. #1
    Registered User
    Join Date
    05-12-2011
    Location
    Delaware
    MS-Off Ver
    Excel 2003
    Posts
    2

    Summary sheet to create multiple worksheets

    Hello - I'm new to the forum and know next to nothing about VBA. Browsing through the threads here, I found a code that could help me at my job. However when I run it I receive an error message - Run-time error 13: Type mismatch.

    Ultimately the macro does what I want it to do and can live with the error, but please help me to understand what went wrong.

    Problems:
    Besides debugging the code, how do I also get it to skip accounts that have the "Amount" field blank? If there is no amount to pay, I don't want the macro to create a new worksheet unnecessarily and to skip to the next account that might.

    Sub Authorization_Sheets()
    ' This Macro creates the authorization sheets for each
    ' fund listed in the main spreadsheet
    ' if sheet doesn't exist already
    Dim LR As Long, Rw As Long
    
    With Sheets("Main")
        LR = .Range("A" & .Rows.Count).End(xlUp).Row
        
        For Rw = 2 To LR
            If Not Evaluate("ISREF('" & .Range("A" & Rw) & "'!A1)") Then
                Sheets("BankForm").Copy After:=Sheets(Sheets.Count)
                ActiveSheet.Name = .Range("B" & Rw)
                [B5].Value = .Range("A" & Rw).Value
                [B6].Value = .Range("C" & Rw).Value
                [B7].Value = .Range("D" & Rw).Value
            End If
        Next Rw
    End With
    
    End Sub
    Attached Files Attached Files
    Last edited by originata; 02-07-2012 at 05:43 PM.

  2. #2
    Forum Expert
    Join Date
    11-29-2010
    Location
    Ukraine
    MS-Off Ver
    Excel 2019
    Posts
    4,168

    Re: Summary sheet to create multiple worksheets

    hi originata, welcome to ExcelForum, please check attachment, press "Run" button
    Attached Files Attached Files

  3. #3
    Registered User
    Join Date
    05-12-2011
    Location
    Delaware
    MS-Off Ver
    Excel 2003
    Posts
    2

    Re: Summary sheet to create multiple worksheets

    I appreciate the help watersev. Solved both problems. Thanks

+ 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