How do I alter this code so the results of the VLOOKUP and RIGHT formulas are converted from text to number?
Sub VLOOKUP()
Dim LastRw As Long
LastRw = Cells(Rows.Count, "A").End(xlUp).Row
' Run VLOOKUP formula starting in B6
With Range("B6")
.FormulaR1C1 = _
"=IFERROR(IF(OR(LEFT(RC[-1],1)=""9"",LEFT(RC[-1],2)<=""32""),VLOOKUP(RC[-1],Gardens,2,FALSE),RC[-1]),"""")"
.AutoFill Destination:=Range("B6:B" & LastRw)
End With
' Applies RIGHT formula to column I and pastes resulting values into column A
With Range("I6:I" & Range("A" & Rows.Count).End(xlUp).Row)
.FormulaR1C1 = "=RIGHT(RC[-8],LEN(RC[-8])-FIND(""-"",RC[-8],1))"
.Copy
Range("A6").PasteSpecial xlPasteValues
.ClearContents
End With
ActiveSheet.PageSetup.PrintArea = Range("A4").CurrentRegion.Address
End Sub
Sub VLOOKUP()
Dim LastRw As Long
LastRw = Cells(Rows.Count, "A").End(xlUp).Row
' Run VLOOKUP formula starting in B6
With Range("B6")
.FormulaR1C1 = _
"=IFERROR(IF(OR(LEFT(RC[-1],1)=""9"",LEFT(RC[-1],2)<=""32""),VLOOKUP(RC[-1],Gardens,2,FALSE),RC[-1]),"""")"
.AutoFill Destination:=Range("B6:B" & LastRw)
End With
' Applies RIGHT formula to column I and pastes resulting values into column A
With Range("I6:I" & Range("A" & Rows.Count).End(xlUp).Row)
.FormulaR1C1 = "=RIGHT(RC[-8],LEN(RC[-8])-FIND(""-"",RC[-8],1))"
.Copy
Range("A6").PasteSpecial xlPasteValues
.ClearContents
End With
ActiveSheet.PageSetup.PrintArea = Range("A4").CurrentRegion.Address
End Sub