Hi All,
Say I have:
Column A: email address
Column B: 6 digit number
Column C: 4 digit number
I want a macro or VBA to create 1 text file for each cell in column A with the data from column B and C for the corresponding cells (e.g. A1.txt containing B1 C1)
This seems simple, but I can't figure out how to do it. I tried a search and I'll admit, I'm not very good with macros or with VBA much at all, but I want to learn. This is the first application I need. Let's assume I don't have python or anything else to work with, just excel 2010.
Any help is greatly appreciated!
Hi
how about
ryloFor Each ce In Range("A1:A" & Cells(Rows.Count, 1).End(xlUp).Row) Open ce & ".txt" For Output As #1 Write #1, ce.Offset(0, 1) & " " & ce.Offset(0, 2) Close #1 Next ce
had to edit the code a bit, but it worked perfectly! So much thanks!Sub Macro1() ' ' Macro1 Macro ' ' Keyboard Shortcut: Ctrl+q ' For Each ce In Range("A1:A" & Cells(Rows.Count, 1).End(xlDown).Row) Open ce & ".txt" For Output As #1 Write #1, ce.Offset(0, 1) & " " & ce.Offset(0, 2) Close #1 Next ce End Sub
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks