rowingengineer
Structural
I am over loading this scripted in the underlined areas, anyone got any ideas on how to do this export in a better fashion.
Sub ExportArchive2()
'
' ExportArchive Macro
' Save ARC_EXPORT as MSDOS text file.
' This is the Microstran Archive File.
'
' ---------------------------------------------
' Your directory is
myDirectory = "C:/"
' ---------------------------------------------
' Go to the sheet with the Microstran File on
Sheets("ARC_FILE (2)").Select
' Store the information by first geting a file name
ChDir myDirectory
fileSaveName = Application.GetSaveAsFilename( _
fileFilter:="Archive Files (*.arc), *.arc")
' Store if a valid name and file is available
If fileSaveName <> False Then
MsgBox "Saving as " & fileSaveName
fileNumber = FreeFile
Open fileSaveName For Output As #fileNumber
' Cycle through the range storing each line as text
For thisRow = 1 To 48000
' Cycle through the range storing each cell on a line
For thisCol = 2 To 11
Print #1, ActiveSheet.Cells(thisRow, thisCol).Text;
Print #1, " ";
Next thisCol
' Finish the line
Print #1,
Next thisRow
Close #fileNumber
' Store the input data acknowledging where placed
Sheets("pre purlin").Select
ActiveSheet.Cells(6, 2).Value = fileSaveName
End If
End Sub
"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning."
Sub ExportArchive2()
'
' ExportArchive Macro
' Save ARC_EXPORT as MSDOS text file.
' This is the Microstran Archive File.
'
' ---------------------------------------------
' Your directory is
myDirectory = "C:/"
' ---------------------------------------------
' Go to the sheet with the Microstran File on
Sheets("ARC_FILE (2)").Select
' Store the information by first geting a file name
ChDir myDirectory
fileSaveName = Application.GetSaveAsFilename( _
fileFilter:="Archive Files (*.arc), *.arc")
' Store if a valid name and file is available
If fileSaveName <> False Then
MsgBox "Saving as " & fileSaveName
fileNumber = FreeFile
Open fileSaveName For Output As #fileNumber
' Cycle through the range storing each line as text
For thisRow = 1 To 48000
' Cycle through the range storing each cell on a line
For thisCol = 2 To 11
Print #1, ActiveSheet.Cells(thisRow, thisCol).Text;
Print #1, " ";
Next thisCol
' Finish the line
Print #1,
Next thisRow
Close #fileNumber
' Store the input data acknowledging where placed
Sheets("pre purlin").Select
ActiveSheet.Cells(6, 2).Value = fileSaveName
End If
End Sub
"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning."