Need Help with this Macro

Shawnathon

New Member
Joined
Feb 16, 2011
Messages
45
OK, this is something I have to do over and over everyday so I need help building a macro for this process.

This is an example of what the sheet has:
A1 = 1 (a number from 1 - 5, represents a text file)
B1 = John Doe (Name)
B2 = John Doe Question 1
B3 = John Doe Answer 1
This will be one "set" that consists of 3 lines, I may have 1 "set" or several "sets" (increments of 3 lines) Example second "set" line 4 - 6, Third "set" line 7 - 9, etc.


The A1 Text file looks like this: [Green,Yellow] XXXXXXX [10,20,30,40,50] [Left,Right,Center]
I normally would have to open this text file and copy B1 (Name) and paste it where the "XXXXXXX" are, then I copy the text file which looks like this: [Green,Yellow] John Doe [10,20,30,40,50] [Left,Right,Center]
and then I paste it into a spinner which spins it into 30 different single line text using the combination's between the "[ ]".

I would imagine this process can be done all in excel and the finished 30 lines can be put on a "new sheet" from A1 - A30

Note: can the macro be set up so if i enter the file # (1 - 5) in cell A1 it can open and use that specific text file? Path and name of file are the same, just the # is different (1 - 5).

Then after that I would need B2 & B3, which are text files, to be imported starting under at A31 on the "new sheet"

Note: Can Text files in B2 & B3 be specified by number entered into a cell? For instance B2 is "John Doe Question 1", the only variation would be the #, so say if I need "John Doe Question 25", I would like to enter the #25 so it can import that text file. The path to the text file would be the same, just the # will be different. (Just like A1)

The final step will be to export the "new sheet" to a text file

I hope this is not too confusing, please let me know if there are any questions to help make this happen, thanks in advance.

Shawn
 

Excel Facts

Convert text numbers to real numbers
Select a column containing text numbers. Press Alt+D E F to quickly convert text to numbers. Faster than "Convert to Number"

Forum statistics

Threads
1,223,911
Messages
6,175,327
Members
452,635
Latest member
laura12345

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top