One solution is to create User Defined Functions (UDF):
Note: you may have to change the sheet name from "worksheet 2" to what ever your actual sheet name is
B2 =WorkNum(A2)
In C2: =WorkStat(A2)
How to install your new code
- Copy the Excel VBA code
- Select the workbook in which you want to store the Excel VBA code
- Press Alt+F11 to open the Visual Basic Editor
- Choose Insert > Module
- Edit > Paste the macro into the module that appeared
- Close the VBEditor
- Save your workbook (Excel 2007+ select a macro-enabled file format, like *.xlsm)
Bookmarks