Please check the worksheet and let know how to upload a code on a worksheet.
Please check the worksheet and let know how to upload a code on a worksheet.
In Excel, click Alt+F11 to open the VB Editor. If you don't see the Project Explorer window on the left of your screen, click Ctl+R to display it (or View > Project Explorer).
In the Project Explorer window you will see a list of available VBA projects. One of these has the name of your open workbook (very likely it will be the only one). If the list of the project's code modules isn't dropped own, click on the little + sign to the left of it. Open the list of code modules in the same way by clicking on the + sign next to "Microsoft Excel Objects".
You will see a list of all the code modules in your workbook. There is one called "ThisWorkbook" and one more for each of the worksheets in your workbook, all arranged alphabetically so that "ThisWorkbook" usually appears at the bottom. All of these are built-in object modules and, actually, for more advanced use than you may need on the first day.
Your first need might be for a standard code module. To add such a module right-click anywhere in the list of modules, or on the VBA project itself, select "Insert" and then "Module". A new category of Excel objects will be added with 'Module1' in it.
Double-click on any of the code modules to open that particular module. Its content will be displayed on the top right of your screen. You can write code into the module there or paste code you obtained elsewhere.
To save the code the workbook must be saved in XLSM format. Excel's default format is XLSX which doesn't support code. If you try to save a workbook containing code in XLSX format a warning will be issued saying that you are about to lose all the code. To save in XLSM format, click File > SaveAs. Select the folder to save to. Below the browser part of the window enter the file name. Below the file name field is another field called "Save as type". Drop down the list of available types by clicking on the arrow at the right of the field. Select "Excel Macro-Enabled Workbook (*.xlsm)" Then click "Save" to save the workbook including the code.