Filename and Contents Added Macro

Job ID: 37390252

Budget: $30 – $250 USD

I am looking for a freelancer who can create a macro that will add a filename and contents to an Excel file.

Requirements:
- The macro should be able to work with Excel files.
- The main task of the macro is to add the filename and contents to the Excel file, without any additional data processing or file handling.
- The macro should be fully automated, requiring no manual activation.

Ideal Skills and Experience:
- Strong knowledge and experience in Excel VBA programming.
- Proficiency in creating macros that can automate tasks in Excel.
- Attention to detail to ensure accurate and efficient execution of the macro.

If you have the required skills and experience, please bid on this project.

----------- The Above was Written by Freelancer. Below is MY Description of What It Should Do----------------------

I want a simple macro written (possibly in VBA for Excel or Python) which adds word(s} onto the ends of a number of text file filenames (usually about 100); the appended words will be supplied from another supplied text file called ‘appendages.txt’. Then the macro should open the text file 'seed-keywords-in.txt" and append the same word(s) to the end of every line of content within the text file.

When this has been done for the last word(s) in the ‘appendages.txt’ file the process will stop.

That’s it!

More detailed description, with example.


I want to rename a file to a number of different filenames, using the text on each line of an input file and appending it to the existing filename. Also, the contents of each renamed file must append the text taken from each line of the file in turn and append it to the end of each line of text in the newly named file.


Here is a description of what needs to be done in greater detail:

There is a text file called ‘appendages.txt’ and another text file called ‘seed-keywords-in.txt’.

The macro will go through all the words in the ‘appendages.txt’ file one by one (one on each line) and copy each one.

It will then add the word(s) to the end of the ‘seed-keywords-in.txt’ file filename.

It will then open the ‘seed-keywords-in.txt’ file and add the word(s) to the end of each line in the ‘seed-keywords-in.txt’ file one by one, until the end of the file.

The macro will then save the new filename as 'seed-keywords-in-[APPENDED WORD(S)].

Then the macro will go to the next word(s) in the ‘appendages.txt’ file and do the same.

The macro will repeat the process with each of the word(s) in the ‘appendages.txt’ file until it completes the process with the last word(s) in the ‘appendages.txt’ file.

Then it will stop.


Example:

I have a text file named ‘appendages.txt’ and another text file named ‘seed-keywords-in.txt’.

The appendages file contains the names of all states in the USA and Canadian provinces, in alphabetical order.

The seed file contains a short description of services such as "divorce lawyer in". There are about 56 lines of similar holiday-based phrases which all end with the word "in". So I want to append a state name to each line of text in the file and rename it to 'seed-keywords-in-[NAME OF STATE].

The first word in the appendages file is "alabama" (lower case). So this is appended to each line within the file. Then the file is renamed 'seed-keywords-in-alabama'.

(All text needs to be in lower case.)

This process should continue to the end of the ‘appendages.txt’ file.

Then the process will end.

----
I have attached three text files:

two input files: appendages.txt and seed-keywords-in.txt

One output file created by the software: seed-keywords-in-alabama.txt

When the process is finished I will have a number of output text files, each named after each state/province in the appendages.txt list. So, in all cases, the number of output files created by the software will be the same as the number of lines in the appendages.txt file.
Related categories: Visual Basic Excel Visual Basic for Apps VB.NET