Hi everybody -
I recorded a macro, and for the most part it does what I need it to. Only one problem... I now need to be able to move the file to another folder location, or allow users to save as and use the workbook on their own. The problem is that in my recorded macro, I think it is referencing my actual current file name to do some things. If they save it off to another location then the macro won't work. It may also be that I actually recorded the "running" of a macro within one of my macros... it may be referencing that. Either way I am not sure how to fix it.
I am hoping someone can re-write this to make that functionality dynamic.
Below is the code (for all 3 macros I am using in the workbook across 2 or 3 tabs).
I am using excel 2010 on windows 7.
Thank you!
I recorded a macro, and for the most part it does what I need it to. Only one problem... I now need to be able to move the file to another folder location, or allow users to save as and use the workbook on their own. The problem is that in my recorded macro, I think it is referencing my actual current file name to do some things. If they save it off to another location then the macro won't work. It may also be that I actually recorded the "running" of a macro within one of my macros... it may be referencing that. Either way I am not sure how to fix it.
I am hoping someone can re-write this to make that functionality dynamic.
Below is the code (for all 3 macros I am using in the workbook across 2 or 3 tabs).
I am using excel 2010 on windows 7.
Thank you!
Code:
Sub SupplierRef()
'
' SupplierRef Macro
'
'
Application.ScreenUpdating = False
Columns("C:C").Select
Selection.Copy
Columns("L:L").Select
ActiveSheet.Paste
Application.CutCopyMode = False
Selection.NumberFormat = "00000000"
Selection.TextToColumns Destination:=Range("M1"), DataType:=xlDelimited, _
TextQualifier:=xlDoubleQuote, ConsecutiveDelimiter:=False, Tab:=False, _
Semicolon:=False, Comma:=False, Space:=False, Other:=True, OtherChar _
:="-", FieldInfo:=Array(Array(1, 2), Array(2, 2)), TrailingMinusNumbers:=True
Range("O2").Select
Range(Selection, Selection.End(xlDown)).Select
Selection.Copy
ActiveWindow.ScrollRow = 65297
ActiveWindow.ScrollRow = 64949
ActiveWindow.ScrollRow = 64428
ActiveWindow.ScrollRow = 63471
ActiveWindow.ScrollRow = 61906
ActiveWindow.ScrollRow = 60167
ActiveWindow.ScrollRow = 57907
ActiveWindow.ScrollRow = 56603
ActiveWindow.ScrollRow = 54168
ActiveWindow.ScrollRow = 52951
ActiveWindow.ScrollRow = 50342
ActiveWindow.ScrollRow = 47212
ActiveWindow.ScrollRow = 45474
ActiveWindow.ScrollRow = 39300
ActiveWindow.ScrollRow = 35562
ActiveWindow.ScrollRow = 33736
ActiveWindow.ScrollRow = 30171
ActiveWindow.ScrollRow = 28345
ActiveWindow.ScrollRow = 24780
ActiveWindow.ScrollRow = 23042
ActiveWindow.ScrollRow = 19651
ActiveWindow.ScrollRow = 16521
ActiveWindow.ScrollRow = 15043
ActiveWindow.ScrollRow = 12173
ActiveWindow.ScrollRow = 10869
ActiveWindow.ScrollRow = 8609
ActiveWindow.ScrollRow = 6609
ActiveWindow.ScrollRow = 5044
ActiveWindow.ScrollRow = 4348
ActiveWindow.ScrollRow = 3131
ActiveWindow.ScrollRow = 2609
ActiveWindow.ScrollRow = 1740
ActiveWindow.ScrollRow = 957
ActiveWindow.ScrollRow = 697
ActiveWindow.ScrollRow = 262
ActiveWindow.ScrollRow = 88
ActiveWindow.ScrollRow = 1
Range("C2").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Range("A2").Select
ActiveCell.FormulaR1C1 = "=RC[1]&RC[2]"
Range("A2").Select
Selection.Copy
Range("A3").Select
Range(Selection, Selection.End(xlDown)).Select
ActiveSheet.Paste
Columns("A:A").Select
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Range("I13").Select
End Sub
Sub PreSupplierRef()
'
' PreSupplierRef Macro
'
'
Columns("L:L").Select
Selection.Copy
Columns("C:C").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Application.Run "'Pref Mstr Pivot Template - FSL - test.xls'!SupplierRef"
End Sub
Sub Data()
'
' Data Macro
'
'
Application.ScreenUpdating = False
Range("I2").Select
Range(Selection, Selection.End(xlDown)).Select
Selection.Copy
ActiveWindow.ScrollRow = 65399
ActiveWindow.ScrollRow = 65312
ActiveWindow.ScrollRow = 65051
ActiveWindow.ScrollRow = 64703
ActiveWindow.ScrollRow = 64182
ActiveWindow.ScrollRow = 63486
ActiveWindow.ScrollRow = 62268
ActiveWindow.ScrollRow = 60790
ActiveWindow.ScrollRow = 58703
ActiveWindow.ScrollRow = 56442
ActiveWindow.ScrollRow = 54094
ActiveWindow.ScrollRow = 51745
ActiveWindow.ScrollRow = 49223
ActiveWindow.ScrollRow = 46875
ActiveWindow.ScrollRow = 45658
ActiveWindow.ScrollRow = 43049
ActiveWindow.ScrollRow = 40440
ActiveWindow.ScrollRow = 37744
ActiveWindow.ScrollRow = 34961
ActiveWindow.ScrollRow = 32352
ActiveWindow.ScrollRow = 29743
ActiveWindow.ScrollRow = 28526
ActiveWindow.ScrollRow = 26091
ActiveWindow.ScrollRow = 23656
ActiveWindow.ScrollRow = 22525
ActiveWindow.ScrollRow = 19568
ActiveWindow.ScrollRow = 18090
ActiveWindow.ScrollRow = 16872
ActiveWindow.ScrollRow = 16264
ActiveWindow.ScrollRow = 15394
ActiveWindow.ScrollRow = 14524
ActiveWindow.ScrollRow = 13742
ActiveWindow.ScrollRow = 13046
ActiveWindow.ScrollRow = 12437
ActiveWindow.ScrollRow = 11828
ActiveWindow.ScrollRow = 11220
ActiveWindow.ScrollRow = 10959
ActiveWindow.ScrollRow = 10437
ActiveWindow.ScrollRow = 9828
ActiveWindow.ScrollRow = 9306
ActiveWindow.ScrollRow = 8785
ActiveWindow.ScrollRow = 8524
ActiveWindow.ScrollRow = 7828
ActiveWindow.ScrollRow = 7393
ActiveWindow.ScrollRow = 6697
ActiveWindow.ScrollRow = 6523
ActiveWindow.ScrollRow = 6176
ActiveWindow.ScrollRow = 5480
ActiveWindow.ScrollRow = 5219
ActiveWindow.ScrollRow = 4871
ActiveWindow.ScrollRow = 4697
ActiveWindow.ScrollRow = 4262
ActiveWindow.ScrollRow = 4088
ActiveWindow.ScrollRow = 3741
ActiveWindow.ScrollRow = 3393
ActiveWindow.ScrollRow = 3219
ActiveWindow.ScrollRow = 2871
ActiveWindow.ScrollRow = 2697
ActiveWindow.ScrollRow = 2349
ActiveWindow.ScrollRow = 2262
ActiveWindow.ScrollRow = 1827
ActiveWindow.ScrollRow = 1653
ActiveWindow.ScrollRow = 1219
ActiveWindow.ScrollRow = 871
ActiveWindow.ScrollRow = 610
ActiveWindow.ScrollRow = 436
ActiveWindow.ScrollRow = 175
ActiveWindow.ScrollRow = 1
Range("J2").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
End Sub