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

Can you sort left to right?
To sort left-to-right, use the Sort dialog box. Click Options. Choose "Sort left to right"

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,123,225
Messages
5,600,406
Members
414,383
Latest member
kevinlarey

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
Top