Macro Question

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I'v never had any dealings w/ macro before, so this is all new to me. I have
a windows 98 computer that is running office 2000 and there is an excel macro
on this pc that was created by someone years ago. I have to get this 98
machine of the network and replace it w/ a 2000/XP platform also running
either office 2000/xp. So far i'v copied the macro and am able to run it, but
its not gathering the correct info. It is collecting the correct info on the
98 machine, just not the one im replacing it w/. It looks like some of the
fields are supposed to be populated w/ info in a text doc, but it looks like
it taking the date of that text file and adding txt at the end. I'v coppied
all the files it needs. What might i be missing, or can i run the macro step
by step to see where it's going wrong. I'v tried step through a couple of
time, but doesn't look like its doing anything. Thanks in advance for any
replies.
 
Post the code, either do alt + F8, select the macro and click edit, then
copy and paste it here, or do Alt + F11, double click the module in the
project pane and do copy and pastel
 
Sub FormatScitexList()
'
' FormatScitexList Macro
' Macro recorded 10/14/2005 by Rosendo
'

'
Windows("records.txt").Activate
Columns("A:A").Select
Columns("A:A").EntireColumn.AutoFit
Selection.Sort Key1:=Range("A1"), Order1:=xlAscending, Header:=xlGuess, _
OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom
Range("B1").Select
Windows("formula.xls").Activate
Selection.Copy
Windows("records.txt").Activate
ActiveSheet.Paste
Application.CutCopyMode = False
Selection.Copy
Range("B2").Select
ActiveWindow.ScrollRow = 7
ActiveWindow.ScrollRow = 11
Range("B2:B30").Select
ActiveSheet.Paste
Range("B1").Select
Windows("formula.xls").Activate
Sheets("Dir Formula").Select
Range("B5:G5").Select
Application.CutCopyMode = False
Selection.Copy
Windows("dir.xls").Activate
Range("B5").Select
ActiveSheet.Paste
Application.CutCopyMode = False
Selection.Copy
Range("B6").Select
ActiveWindow.SmallScroll Down:=14
Range("B6:B30").Select
ActiveSheet.Paste
Range("E5").Select
Windows("formula.xls").Activate
Range("B2:B3").Select
Application.CutCopyMode = False
Selection.Copy
Windows("dir.xls").Activate
Range("B2").Select
ActiveSheet.Paste
Range("E5").Select
Windows("formula.xls").Activate
Range("E5").Select
Application.CutCopyMode = False
Selection.Copy
Windows("dir.xls").Activate
ActiveSheet.Paste
Columns("B:B").Select
Selection.ColumnWidth = 13.57
Columns("C:C").Select
Columns("C:C").EntireColumn.AutoFit
Columns("D:D").Select
Columns("D:D").EntireColumn.AutoFit
Columns("E:E").Select
Columns("E:E").EntireColumn.AutoFit
Columns("F:F").Select
Selection.ColumnWidth = 6.86
Columns("G:G").Select
Columns("G:G").EntireColumn.AutoFit
Columns("B:G").Select
Application.CutCopyMode = False
Selection.Copy
Range("A1").Select
ActiveSheet.PasteSpecial Format:=3, Link:=1, DisplayAsIcon:=False, _
IconFileName:=False
Columns("A:A").Select
Selection.ColumnWidth = 12
Columns("B:B").Select
Selection.ColumnWidth = 13.71
Columns("B:B").EntireColumn.AutoFit
Columns("C:C").Select
Columns("C:C").EntireColumn.AutoFit
Range("D5").Select
Windows("formula.xls").Activate
Selection.Copy
Windows("dir.xls").Activate
ActiveSheet.Paste
Application.CutCopyMode = False
Selection.Copy
Range("D6").Select
ActiveWindow.ScrollRow = 7
ActiveWindow.ScrollRow = 8
Range("D6:D30").Select
ActiveSheet.Paste
Columns("E:E").ColumnWidth = 6.71
Columns("F:F").Select
Columns("F:F").EntireColumn.AutoFit
Columns("G:G").Select
Application.CutCopyMode = False
Selection.Delete Shift:=xlToLeft
Range("G5").Select
Windows("records.txt").Activate
Columns("B:B").Select
Selection.Copy
Windows("dir.xls").Activate
Windows("formula.xls").Activate
Windows("records.txt").Activate
Range("B1").Select
ActiveWindow.ScrollRow = 10
Range("B1:B30").Select
Application.CutCopyMode = False
Selection.Copy
Windows("dir.xls").Activate
Selection.PasteSpecial Paste:=xlValues, Operation:=xlNone, SkipBlanks:= _
False, Transpose:=False
Cells.Select
Application.CutCopyMode = False
With Selection.Font
.Name = "Arial"
.Size = 16
.Strikethrough = False
.Superscript = False
.Subscript = False
.OutlineFont = False
.Shadow = False
.Underline = xlUnderlineStyleNone
.ColorIndex = xlAutomatic
End With
Columns("A:A").Select
Selection.ColumnWidth = 19.14
Columns("B:B").Select
Columns("B:B").EntireColumn.AutoFit
Columns("C:C").Select
With Selection
.HorizontalAlignment = xlRight
.VerticalAlignment = xlBottom
.WrapText = False
.Orientation = 0
.AddIndent = False
.ShrinkToFit = False
.MergeCells = False
End With
Columns("C:C").EntireColumn.AutoFit
Columns("E:E").Select
Columns("E:E").EntireColumn.AutoFit
Selection.ColumnWidth = 10.29
Columns("F:F").Select
Columns("F:F").EntireColumn.AutoFit
Columns("G:G").Select
With Selection
.HorizontalAlignment = xlLeft
.VerticalAlignment = xlBottom
.WrapText = False
.Orientation = 0
.AddIndent = False
.ShrinkToFit = False
.MergeCells = False
End With
Selection.ColumnWidth = 15
ActiveWindow.SmallScroll ToRight:=1
Selection.ColumnWidth = 19.14
ActiveWindow.LargeScroll ToRight:=-1
Cells.Select
With ActiveSheet.PageSetup
.PrintTitleRows = ""
.PrintTitleColumns = ""
End With
ActiveSheet.PageSetup.PrintArea = ""
With ActiveSheet.PageSetup
.LeftHeader = ""
.CenterHeader = ""
.RightHeader = ""
.LeftFooter = "Labels Checked by:" & Chr(10) & "Frank Fajardo" &
Chr(10) & "Bob Berthold"
.CenterFooter = ""
.RightFooter = ""
.LeftMargin = Application.InchesToPoints(0.5)
.RightMargin = Application.InchesToPoints(0.25)
.TopMargin = Application.InchesToPoints(1)
.BottomMargin = Application.InchesToPoints(1)
.HeaderMargin = Application.InchesToPoints(0.5)
.FooterMargin = Application.InchesToPoints(0.5)
.PrintHeadings = False
.PrintGridlines = False
.PrintComments = xlPrintNoComments
.PrintQuality = 600
.CenterHorizontally = False
.CenterVertically = False
.Orientation = xlLandscape
.Draft = False
.PaperSize = xlPaperLetter
.FirstPageNumber = xlAutomatic
.Order = xlDownThenOver
.BlackAndWhite = False
.Zoom = 100
End With
Columns("F:F").Select
Columns("F:F").EntireColumn.AutoFit
Rows("5:5").Select
ActiveWindow.ScrollRow = 20
ActiveWindow.SmallScroll Down:=2
Rows("5:34").Select
Selection.Font.Bold = True
Range("A4").Select
End Sub

Thanks
 
Back
Top