Sishir Roy, a recent graduate in Civil Engineering from Bangladesh University of Engineering and Technology, has dedicated over a year to the ExcelDemy project. As an Excel and VBA Content Developer, he has authored 50+ articles, updated 100+, and solved complex Excel VBA challenges. Excelling in troubleshooting and simplifying problems, his love for diverse problem-solving and aiding others is evident in his keen interests in Data Analysis, Advanced Excel, VBA Macro, and Excel Power Query, enriching the project's dynamic environment.
Download Practice Workbook Burndown Chart.xlsx What Is Burndown Chart in Excel? A burndown chart is used to monitor the amount of work ...
This is an overview Download Practice Workbook Subtotals in Excel.xlsx How to Calculate Subtotals in Excel 1. Using the Subtotal ...
This is an overview Click the image for a detailed view. Download Practice Workbook Compatibility Mode.xls Compatibility Mode.xlsx ...
Method 1 - Using Mixed Fraction Technique to Display Fraction In cell D5, we have written a proper fraction in a mixed fraction manner, where 0 represents ...
For example, in the GIF below, you can see that we have selected the header row of our dataset. We have used the Rows property along with the Select method to ...
Method 1 - Using the Error Checking Indicator This method is only applicable if you see an error indicator in the top left corner of a cell like the image ...
Hello ANDRES,
Thank you for reaching out to us. It appears that you want to store the username (which is the first column) and only the numeric values in your Excel file from your text file.
To achieve this, you can use the following code:
This code will import multiple rows of data with the username and numeric values from your text file into Excel.
For demonstration, I have created a text file like the image below:
After running the code and choosing the text file, you will get an output like this:
Let me know if you have any questions or if there’s anything else I can help you with!
Regards,
Sishir Roy
Yes REL. You’re correct. The potential issue in the code lies in the line:
Worksheets(i).SaveAs Filename:=Full_Name
This line of code saves the entire workbook, not just the individual sheet. As a result, when you open the saved files, you see all the tabs because you saved the entire workbook, not just the specific sheet.If you want to save each sheet of your current workbook as a separate file and not the entire workbook, you can use the following code:
Hello LILY,
The formula used in the section “How to Include Space Between Numbers and Text in Excel” is a complex formula designed to insert a space after the rightmost numeric sequence in the text in a cell and then trim any extra spaces. It does not insert a space before the numeric sequence and only inserts a space after the rightmost numeric sequence. For example, you can see the image below.
The issue you are facing might be due to certain functions not working correctly in your Excel version. Consider using the latest version to avoid these problems.
However, the formula in the provided section does not insert space before the numeric sequence, making it less versatile. If you wish to insert a space between text and numbers regardless of the order of the numeric sequence, I can provide you with a VBA code to address this. If you want to insert a space before and after each numeric sequence without spaces between individual digits, you can use the following VBA function:
To use this, open the VBA launcher by pressing the Alt+F11 button on your keyboard.
Click on the Insert button and choose the Module option.
In the Module section, paste the provided VBA code.
After that, go back to your Excel file, and type the function name ‘=InsertSpacesAroundNumbers‘. You will find the function name in the function list. Put the cell reference in the function argument and press Enter.
As a result, it will insert a space before and after each numeric sequence without inserting spaces between individual digits.
Regards,
Sishir Roy
Hi BISMARK,
The provided code can be executed multiple times. Each time you run the subroutine, it refreshes the data of a closed Excel file without manually opening it.
The code does not alter or have any impact on the Excel file where the macro is located. The macro’s file doesn’t change. The code opens the separate Excel file indicated by the FilePath variable, then updates the links in that file before closing it. The actions are performed on the opened file, not the file where the macro code is located.
It’s important to remember that if the macro is kept in the same workbook as the file you need to edit, you may modify the code to refer to the current workbook rather than using a distinct FilePath variable.
Best Regards,
Sishir Roy
Hello ANNAWHO,
The workbook (the one that is indicated by the ‘FilePath’) that is opened and changed with new data will be saved before it is closed in the supplied code of this article. The line “ActiveWorkbook.Close True” indicates that the file will be saved with any changes made to it before closing.
However, the workbook containing the VBA code itself, the file where the macro resides, will not be saved as a result of running this code. The workbook that contains the code isn’t saved by the code itself.
Best Regards,
Sishir Roy