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: 1
  • Concatenated Message Tab.PNG
    Concatenated Message Tab.PNG
    140.7 KB · Views: 1

Some videos you may like

Excel Facts

Does the VLOOKUP table have to be sorted?
No! when you are using an exact match, the VLOOKUP table can be in any order. Best-selling items at the top is actually the best.

neuro0101man

Banned - Rule violations
Joined
Aug 17, 2020
Messages
7
Office Version
  1. 365
  2. 2016
Platform
  1. Windows
  2. Mobile
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)
 

Watch MrExcel Video

Forum statistics

Threads
1,118,269
Messages
5,571,225
Members
412,372
Latest member
JON_ROCKS
Top