LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default Excel macros

Hello
I have made a macro and want it to be more general,so that I can apply
it with any .log text file delivered by a audio ripping program. I want
a 'file open' at the beginning and a 'save as' at the end.
The trouble is that the macro will only work on the original data,
which is not much use.
I have been using the import data option to bring in the data which is
fixed width and use it in a prepared template.

I know nothing about Visual Basic, I do know that is what I need to
make the macro more general.

I can post the text of the macro.

Sub Format1()
'
' Format1 Macro
' Macro recorded 23/10/2005 by Engles
'

'
Range("A2").Select
With
ActiveSheet.QueryTables.Add(Connection:="TEXT;O:\B BCSO\BBCSO002.log", _
Destination:=Range("A2"))
.Name = "BBCSO002"
.FieldNames = True
.RowNumbers = False
.FillAdjacentFormulas = False
.PreserveFormatting = True
.RefreshOnFileOpen = False
.RefreshStyle = xlInsertDeleteCells
.SavePassword = False
.SaveData = True
.AdjustColumnWidth = True
.RefreshPeriod = 0
.TextFilePromptOnRefresh = False
.TextFilePlatform = xlWindows
.TextFileStartRow = 1
.TextFileParseType = xlFixedWidth
.TextFileTextQualifier = xlTextQualifierDoubleQuote
.TextFileConsecutiveDelimiter = False
.TextFileTabDelimiter = True
.TextFileSemicolonDelimiter = False
.TextFileCommaDelimiter = False
.TextFileSpaceDelimiter = False
.TextFileColumnDataTypes = Array(1, 1, 1, 1, 9)
.TextFileFixedColumnWidths = Array(20, 15, 36, 19)
.Refresh BackgroundQuery:=False
End With
ChDir "O:\BBCSO"
ActiveWorkbook.SaveAs Filename:="O:\BBCSO\BBCSO.xls",
FileFormat:=xlNormal _
, Password:="", WriteResPassword:="",
ReadOnlyRecommended:=False, _
CreateBackup:=False
End Sub

Thanks for your help

Mike Engles

 
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
Excel 2007 macros - how to merge 5 macros together into one Sue Excel Discussion (Misc queries) 1 April 16th 08 08:36 PM
Training: More on how to use macros in Excel: Recording Macros ToriT Excel Worksheet Functions 2 February 10th 06 07:05 PM
convert lotus 123w macros to excel macros rpiescik[_2_] Excel Programming 1 September 19th 04 12:41 PM
convert lotus 123w macros to excel macros rpiescik Excel Programming 1 September 18th 04 01:35 PM
Making excel macros run Word macros Matthew McManus Excel Programming 1 February 18th 04 02:57 AM


All times are GMT +1. The time now is 12:11 AM.

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

About Us

"It's about Microsoft Excel"