I want to read the text from excel and find the corresponding folder in windows.
Let say, I have excel file containing the list of folder I want to open in file explorer.
and here is my folder.
So I want to read from excel file on cell A2, then after read “dotnet”, I want to find in the screen, where is “dotnet” folder. I have tried using function “text exist”. However, it wasnt working.
Can anybody tell me which function should I use to find the corresponding folder?
Use read range activity to read all data from excel. Once you have the directory, use for each item in data table, you can simply open run command with send hot key (win + r) and type into your directory.
That should open the folder up for you.
Related
I am having a folder of 10 excel-based CSV files. Is there any method to copy the data from all these files into 1 excel
Not good with VBA, so thought to ask you guys
On a first sight, I would go for the following approach (coming up with the codes is up to you, Google is your friend):
Get a list of all file names within that directory
Iterate over every item from the above list and open the file with Workbooks.Open(...)
Copy the whole content and paste it to the additional Excel you want to manage to hold the data of all files
Repeat the steps for each file
Remember to save the last row after every paste s.t. you can continue with amending the data into the addtional Excel instead of replacing the content.
I have multiple Excel files in the same format and I want to combine them into a single file.
How can I merge them into one single excel file using VBA?
VBA is no longer required to merge files. You can use Power Query and merge all files in the same folder with just a few clicks. When the files change, you just update the query.
You have two choices:
a "flat" file, in which all the data are in a single sheet (BAD)
A multi-sheet file (GOOD)
In the first case open a new file, cut and paste your existing content into the new (single) sheet
In the second case Move/Copy the sheets to a New Document.
There: you now have enough Google fodder to get you started.
I had this same issue a while back and found an excellent solution thanks to my good friend Google. All credit for this solution goes to the following page: computer hope
To merge Microsoft Excel files together, save them as CSV files first (it would be possible to automate this part in VBA if there is a recurrent need). Open the Excel files and in the menu bar, click File, then Save As. In the Save as type drop-down list, select CSV (comma delimited) (*.csv) from the list.
Do this for each Excel file you want to merge, then place all the CSV files in the same folder. For ease, place them in a folder in the root of the C: drive (e.g., c:\csvfiles).
Open the Windows command prompt (to get to this, in the Search or Run line, type cmd and press return) and navigate to the folder containing the CSV files. Type dir to view the files in the folder and ensure all the files are there.
Type in the following command to merge all CSV files in the folder into a new CSV file titled "newfile.csv" (any name could be used):
copy *.csv newfile.csv
After the new file is created, open the new CSV file in Microsoft Excel and save it as an Excel file.
I have created a hyperlink that connects to the files which exist in the same directory (or subdirectory) as the Excel file. How do I point to the file without setting the full path? The reason I don't want to give the full path is that if I moved the directory which contains other files and the Excel file to a different location, the hyperlinks shouldn't break.
I tried the option below, but the hyperlink only works if I don't move the files.
I want to assign the hyperlink an address like Example\IndexUsage_notes.txt instead of the full path D:\SCRIPTS\ADMIN_SCRIPTS\Example\IndexUsage_notes.txt
After searching online, I found this articles to be useful:
https://www.extendoffice.com/documents/excel/631-excel-file-location.html
This shows you how to get the file path of your workbook and how to isolate the main directory without using Macros.
Then you can insert your main file directory, sub-directory, and filename into the HYPERLINK function.
You can add text to the main directory using TEXT($B$1,0)&TEXT($B$2,0)&......
Dynamic Hyperlink Spreadsheet.png
Once the sub-directories are created and files are in place, you may not be able to move them easily without changing the sub-directory name manually within the spreadsheet or using Macros.
When a formula in Excel refers to a cell in another file, Excel stores a relative pathname so that if you move the files the links don't break. This works as I expect when the files are stored on a network drive, but not when the files are stored in a SharePoint doc library. Any ideas why and how I can fix it?
In more detail ...
Setup 1 (works perfectly)
\\server\UserFiles$\MClarke\My Documents\Folder1\a.xlsx includes the formula ='\\server\UserFiles$\MClarke\My Documents\Folder1\[b.xlsx]Sheet1'!$A$1
Move both files from Folder1 to Folder2
Open \\server\UserFiles$\MClarke\My Documents\Folder2\a.xlsx and the formula automatically changes to ='\\server\UserFiles$\MClarke\My Documents\Folder2\[b.xlsx]Sheet1'!$A$1
Setup 2 (fails)
http://intranet-server/dept/Folder1/a.xlsx includes the formula ='http://intranet-server/dept/Folder1/[b.xlsx]Sheet1'!$A$1
Move both files from Folder1 to Folder2
Open http://intranet-server/dept/Folder2/a.xlsx and the formula (incorrectly) still says ='http://intranet-server/dept/Folder1/[b.xlsx]Sheet1'!$A$1
I have tried moving and opening files in Setup 2 with both a mapped network drive and using SharePoint's "Open with Explorer" function. Both approaches give the same undesired behaviour: the formula in the moved file continues to point to the original location of the file rather than the new location. So why would Excel store an absolute path in that case but a relative path in Setup 1?
I tried many alternatives and eventually found that the only way to update the file references was to do so manually using the Edit Links dialog from the Data ribbon. That works perfectly, but is just a bit annoying.
I have written a macro which opens 2 comma delimited files (Generic Tables used by Prophet 8.1 ending with a .fac extension), does a comparison and creates another workbook which highlights all the differences.
The macro seems to fail when the files have the same name but has different directories.
What would be the easiest way to overcome this problem without having to actually change the file name as seen in the location? It is against company policy to mess with the actual files as seen in the location. Is there a way to assign some temporary name to the file and not save it?
In Excel you cannot have two files open with the same name!
If you don't want to rename the files, copy one temporarily using a different name - and delete it afterwards (assuming you only want to read from it)
If you have to modify/save the original files, then the only two options you have is to rename them (you can afterwards rename them back to the original name) - or change your procedure so only one file is open at the time (e.g. by temporarily storing some data from the first file in a temp workbook that gets created and closed during the code execution).