LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,391
Default Creating A Text File From Single Column Via Macro

It may help if you even looked at the code I have posted.

NickHK

wrote in message
oups.com...
Woudl it be possible to write the whole Macro with that functionality
in it please? I have tried this:

Sub ExportToPRN()
Dim FName As String
Dim WholeLine As String
Dim FNum As Integer
Dim myRange As Range
Dim myCell As Range
Dim myName As String
Dim Cell As Range
Dim OutputDir As String

myName = ActiveWorkbook.FullName

FName = Application.GetSaveAsFilename( _
Replace(myName, ".xls", ".prn"))

On Error GoTo EndMacro:
FNum = FreeFile

Open FName For Output Access Write As #FNum
Set myRange = Range("C1:C2")
WholeLine = ""

For Each myCell In myRange

WholeLine = WholeLine & "\" & myCell.Text & vbNewLine
MkDir OutputDir & Cell.Value

Next myCell

WholeLine = Left(WholeLine, Len(WholeLine) - 1)

Print #FNum, Trim(WholeLine)

EndMacro:
On Error GoTo 0
Close #FNum
End Sub

But have had no success. What am I doing wrong?



 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Creating mulitple workbooks from single workbook - *Macro tweaking needed* Dan Excel Programming 2 February 15th 07 11:52 PM
Creating a single vertical array from multiple column arrays Bryan Excel Worksheet Functions 2 December 10th 05 07:12 PM
Can delimited text file imports be extracted to a single column i. JROD Excel Discussion (Misc queries) 1 April 1st 05 05:57 AM
Creating single lines of data from a multi-column table hywel Excel Discussion (Misc queries) 3 February 11th 05 10:32 PM
Read a single column text file mluetkem[_2_] Excel Programming 3 November 25th 03 04:03 AM


All times are GMT +1. The time now is 06:49 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"