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
Last edited by originata; 02-07-2012 at 04:43 PM.
hi originata, welcome to ExcelForum, please check attachment, press "Run" button
I appreciate the help watersev. Solved both problems. Thanks
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks