The Macro I made requires 2 open workbook. 1st workbook is where it will automatically be filled up based on the contents of the 2nd workbook.
The macro will ask the name of the 2nd workbook then after clicking "ok", the 1st workbook will be filled with the data.
the name of the workbook is acquired using this:
wname = InputBox(Prompt:="Workbook name(do not include .xls):", _
Title:="CRYSTAL REPORT", Default:="workbook name here")
then it will be put in this code:
ActiveCell.FormulaR1C1 = _
"=IFERROR(VLOOKUP(RC[-1],[" & wname & ".xls" & "]Sheet1!R2C3:R60000C11,9,0),"""")"
The Problem: If wname(workbook name) consist of special characters, specifically open/close parenthesis, hypen.... the macro crashes because of error...
I tried using char(40), chr(41) ... but error again.
The macro will ask the name of the 2nd workbook then after clicking "ok", the 1st workbook will be filled with the data.
the name of the workbook is acquired using this:
wname = InputBox(Prompt:="Workbook name(do not include .xls):", _
Title:="CRYSTAL REPORT", Default:="workbook name here")
then it will be put in this code:
ActiveCell.FormulaR1C1 = _
"=IFERROR(VLOOKUP(RC[-1],[" & wname & ".xls" & "]Sheet1!R2C3:R60000C11,9,0),"""")"
The Problem: If wname(workbook name) consist of special characters, specifically open/close parenthesis, hypen.... the macro crashes because of error...
I tried using char(40), chr(41) ... but error again.