Macro to Take concatenated column and post to txt file

AlwaysLearning2018

Board Regular
Joined
Nov 23, 2018
Messages
51
Hi All,

I am trying to figure out a way to automate as much as possible a process to take a concatenated column and write it to Notepad to create a .txt file. On the attached images of a spreadsheet, a group I work with pastes data into the Holdings File tab and then copies the concatenated message in Column A and then pastes into the Notepad application. There's sometimes 30,000 rows of data so what happens is 8 people split up this task, and go through copying the concatenated column and pasting into notepad.

I am looking for a macro to speed this up. Also looking for the macro to load only 100 rows at a time based on the cusip in column C and the from portfolio data in column J. These columns are variable as this holdings file information that is pasted in on the holdings file tab contains multiple cusip data items and multiple from portfolio items. I am trying to create something that will write to Notepad based on Cusip (Column C) and Portfolio (Column J) while again loading maybe only 100 rows at a time to Notepad, stopping, then repeating another 100 and so on until all rows are looked at.


I honestly don't know how to go about doing this so any help would be very much appreciated.

Thank you!
 

Attachments

  • Holdings File Tab.PNG
    Holdings File Tab.PNG
    138 KB · Views: 3
  • Concatenated Message Tab.PNG
    Concatenated Message Tab.PNG
    140.7 KB · Views: 3

Excel Facts

Excel motto
Not everything I do at work revolves around Excel. Only the fun parts.
what you are wanting to do is called ""in/out"". e.g. - ''I/O''. it's also called ""data streaming"". VBA has all sorts of functions to do this. you probably CAN open the notepad application and write bytes to it literally, but I would guess you would have to use the SENDKEYS() command or something like that. or maybe even delve into windows powershell. that's a waste of time and not valuable. consider some of these articles from MS on ''i/o'' streaming into a text file from any VBA-oriented source:

VBA print statement

VBA create text file method (with WRITELINE method)
 
Upvote 0

Forum statistics

Threads
1,215,036
Messages
6,122,794
Members
449,095
Latest member
m_smith_solihull

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