assistantyinka
New Member
- Joined
- Mar 29, 2013
- Messages
- 2
First I want to apologize in advance for pasting my code like an amateur. I am.
Simply put the VLOOKUP line is giving me a runtime error 13: type Mismatch. Why? and help!
Sub AddStaticInfo()
Sub ClearValues()
Sub NextFiveDay()
Sub SaveFiveDayWithNewName()
Simply put the VLOOKUP line is giving me a runtime error 13: type Mismatch. Why? and help!
Sub AddStaticInfo()
'because when the active sheet is saved, I want the data in it to be frozen for future reference and not update everytime the saved file is opened'
Range("C20") = Now
Range("D30") = Now
'These are dates'
Range("B4") = Range("B4").Value
'this is amount in words'
Range("D4") = Range("D4").Value
'this is amount in figure'
Range("B8") = Range("B8").Value
'this is address'
End SubRange("C20") = Now
Range("D30") = Now
'These are dates'
Range("B4") = Range("B4").Value
'this is amount in words'
Range("D4") = Range("D4").Value
'this is amount in figure'
Range("B8") = Range("B8").Value
'this is address'
Sub ClearValues()
Range("B4").ClearContents
Range("D4").ClearContents
Range("B8").ClearContents
Range("B2").ClearContents
Range("B30,C33,C34").ClearContents
End SubRange("D4").ClearContents
Range("B8").ClearContents
Range("B2").ClearContents
Range("B30,C33,C34").ClearContents
Sub NextFiveDay()
Range("C43").Value = Range("C43").Value + 1
'cosmetic: like an invoice number: helps to keep files for the same people unique'
'the formulas below pull the amount in words and number for the name typed in cell B2'
Range("B4").Value = " = VLOOKUP( " * "&B2&" * ",'C:\Users\Tria Adelfi\Documents\Five Day\[balances (USED FOR NOTICES).xlsm]Sheet1'!$A$2:$G$197,4,FALSE)"
Range("D4").Value = " = VLOOKUP(" * "&B2&" * ",'C:\Users\Tria Adelfi\Documents\Five Day\[balances (USED FOR NOTICES).xlsm]Sheet1'!$A$2:$G$197,3,FALSE)"
Range("B8").Value = " = VLOOKUP(" * "&B2&" * ",'C:\Users\Tria Adelfi\Documents\Five Day\[balances (USED FOR NOTICES).xlsm]Sheet1'!$A$2:$G$197,2,FALSE)"
Range("C20") = "=Now()"
Range("D30") = "=Now()"
End Sub'cosmetic: like an invoice number: helps to keep files for the same people unique'
'the formulas below pull the amount in words and number for the name typed in cell B2'
Range("B4").Value = " = VLOOKUP( " * "&B2&" * ",'C:\Users\Tria Adelfi\Documents\Five Day\[balances (USED FOR NOTICES).xlsm]Sheet1'!$A$2:$G$197,4,FALSE)"
Range("D4").Value = " = VLOOKUP(" * "&B2&" * ",'C:\Users\Tria Adelfi\Documents\Five Day\[balances (USED FOR NOTICES).xlsm]Sheet1'!$A$2:$G$197,3,FALSE)"
Range("B8").Value = " = VLOOKUP(" * "&B2&" * ",'C:\Users\Tria Adelfi\Documents\Five Day\[balances (USED FOR NOTICES).xlsm]Sheet1'!$A$2:$G$197,2,FALSE)"
Range("C20") = "=Now()"
Range("D30") = "=Now()"
Sub SaveFiveDayWithNewName()
AddStaticInfo
Dim NewFN As Variant
' Copy Five Day to a new workbook'
ActiveSheet.Copy
NewFN = "\\RSC-13483\Users\Tria Adelfi\Documents\Five Day\FD_" & Range("B2").Value & "_" & Range("C43").Value & ".xlsx"
ActiveWorkbook.SaveAs NewFN, FileFormat:=xlOpenXMLWorkbook
ActiveWorkbook.Close
ClearValues
NextFiveDay
End SubDim NewFN As Variant
' Copy Five Day to a new workbook'
ActiveSheet.Copy
NewFN = "\\RSC-13483\Users\Tria Adelfi\Documents\Five Day\FD_" & Range("B2").Value & "_" & Range("C43").Value & ".xlsx"
ActiveWorkbook.SaveAs NewFN, FileFormat:=xlOpenXMLWorkbook
ActiveWorkbook.Close
ClearValues
NextFiveDay