Hi,
I am running excel 2010 with windows 7. I created a macro in sheet 1 and I wish to activate the macro from sheet 2 using a form button. I have entered the code below. I know how to perform this function on a more simple macro like adding names to cells. This code is a bit more complex I just dont know where to start. Any help would be appreciated.
I am running excel 2010 with windows 7. I created a macro in sheet 1 and I wish to activate the macro from sheet 2 using a form button. I have entered the code below. I know how to perform this function on a more simple macro like adding names to cells. This code is a bit more complex I just dont know where to start. Any help would be appreciated.
Code:
Sub LoanData()
'
' LoanData Macro
'
'
Cells.Select
Cells.EntireColumn.AutoFit
Range("B3").Select
Selection.AutoFilter
Range("E8").Select
ActiveSheet.Range("$A$1:$M$1001").AutoFilter Field:=5, Criteria1:=Array( _
"00978 - Everest University Online, Tempe, AZ", _
"00988 - Everest Online - Colorado Springs, CO", _
"00988 - Everest Online - Orlando South, FL"), Operator:=xlFilterValues
Rows("5:5").Select
ActiveWindow.ScrollRow = 3
ActiveWindow.ScrollRow = 6
ActiveWindow.ScrollRow = 13
ActiveWindow.ScrollRow = 19
ActiveWindow.ScrollRow = 35
ActiveWindow.ScrollRow = 62
ActiveWindow.ScrollRow = 101
ActiveWindow.ScrollRow = 168
ActiveWindow.ScrollRow = 277
ActiveWindow.ScrollRow = 310
ActiveWindow.ScrollRow = 348
ActiveWindow.ScrollRow = 371
ActiveWindow.ScrollRow = 394
ActiveWindow.ScrollRow = 429
ActiveWindow.ScrollRow = 459
ActiveWindow.ScrollRow = 511
ActiveWindow.ScrollRow = 540
ActiveWindow.ScrollRow = 592
ActiveWindow.ScrollRow = 623
ActiveWindow.ScrollRow = 664
ActiveWindow.ScrollRow = 687
ActiveWindow.ScrollRow = 727
ActiveWindow.ScrollRow = 744
ActiveWindow.ScrollRow = 767
ActiveWindow.ScrollRow = 782
ActiveWindow.ScrollRow = 799
ActiveWindow.ScrollRow = 809
ActiveWindow.ScrollRow = 813
ActiveWindow.ScrollRow = 816
ActiveWindow.ScrollRow = 818
ActiveWindow.ScrollRow = 824
ActiveWindow.ScrollRow = 833
ActiveWindow.ScrollRow = 850
ActiveWindow.ScrollRow = 867
ActiveWindow.ScrollRow = 898
ActiveWindow.ScrollRow = 902
ActiveWindow.ScrollRow = 913
ActiveWindow.SmallScroll Down:=531
Rows("5:1500").Select
Selection.Delete Shift:=xlUp
Range("C601").Select
ActiveSheet.ShowAllData
Range("E5").Select
ActiveWindow.ScrollColumn = 2
ActiveWindow.ScrollColumn = 3
ActiveWindow.ScrollColumn = 4
ActiveWindow.ScrollColumn = 5
ActiveWindow.ScrollColumn = 6
ActiveWindow.ScrollColumn = 7
ActiveWindow.ScrollColumn = 8
ActiveSheet.Range("$A$1:$M$581").AutoFilter Field:=10, Criteria1:=Array( _
"Cancelled - School Request - Reapply Option", "Cancelled: Credit Error", _
"Cancelled-Loan Documents Expired"), Operator:=xlFilterValues
ActiveWindow.SmallScroll Down:=-6
Rows("82:82").Select
Range("H82").Activate
ActiveWindow.ScrollRow = 3
ActiveWindow.ScrollRow = 93
ActiveWindow.ScrollRow = 112
ActiveWindow.ScrollRow = 122
ActiveWindow.ScrollRow = 144
ActiveWindow.ScrollRow = 155
ActiveWindow.ScrollRow = 173
ActiveWindow.ScrollRow = 184
ActiveWindow.ScrollRow = 201
ActiveWindow.ScrollRow = 208
ActiveWindow.ScrollRow = 219
ActiveWindow.ScrollRow = 224
ActiveWindow.ScrollRow = 228
ActiveWindow.ScrollRow = 233
ActiveWindow.ScrollRow = 236
ActiveWindow.ScrollRow = 241
ActiveWindow.ScrollRow = 242
ActiveWindow.ScrollRow = 247
ActiveWindow.ScrollRow = 251
ActiveWindow.ScrollRow = 261
ActiveWindow.ScrollRow = 267
ActiveWindow.ScrollRow = 282
ActiveWindow.ScrollRow = 294
ActiveWindow.ScrollRow = 314
ActiveWindow.ScrollRow = 330
ActiveWindow.ScrollRow = 359
ActiveWindow.ScrollRow = 379
ActiveWindow.ScrollRow = 411
ActiveWindow.ScrollRow = 436
ActiveWindow.ScrollRow = 477
ActiveWindow.ScrollRow = 497
ActiveWindow.ScrollRow = 517
ActiveWindow.ScrollRow = 543
ActiveWindow.ScrollRow = 550
ActiveWindow.ScrollRow = 554
ActiveWindow.ScrollRow = 557
ActiveWindow.ScrollRow = 562
ActiveWindow.ScrollRow = 568
ActiveWindow.ScrollRow = 574
ActiveWindow.ScrollRow = 577
ActiveWindow.ScrollRow = 586
ActiveWindow.ScrollRow = 596
ActiveWindow.ScrollRow = 606
ActiveWindow.ScrollRow = 625
ActiveWindow.ScrollRow = 643
ActiveWindow.ScrollRow = 672
ActiveWindow.ScrollRow = 691
ActiveWindow.ScrollRow = 720
ActiveWindow.ScrollRow = 737
ActiveWindow.ScrollRow = 755
ActiveWindow.ScrollRow = 765
ActiveWindow.ScrollRow = 775
ActiveWindow.ScrollRow = 783
ActiveWindow.ScrollRow = 792
ActiveWindow.ScrollRow = 797
ActiveWindow.ScrollRow = 805
ActiveWindow.ScrollRow = 809
ActiveWindow.ScrollRow = 817
ActiveWindow.ScrollRow = 820
ActiveWindow.ScrollRow = 823
ActiveWindow.ScrollRow = 828
ActiveWindow.ScrollRow = 831
ActiveWindow.ScrollRow = 835
ActiveWindow.ScrollRow = 838
ActiveWindow.ScrollRow = 843
ActiveWindow.ScrollRow = 846
ActiveWindow.ScrollRow = 854
ActiveWindow.ScrollRow = 858
ActiveWindow.ScrollRow = 871
ActiveWindow.ScrollRow = 877
ActiveWindow.ScrollRow = 888
ActiveWindow.ScrollRow = 894
ActiveWindow.ScrollRow = 906
ActiveWindow.ScrollRow = 914
ActiveWindow.ScrollRow = 923
ActiveWindow.ScrollRow = 931
ActiveWindow.ScrollRow = 940
ActiveWindow.ScrollRow = 946
ActiveWindow.ScrollRow = 952
ActiveWindow.ScrollRow = 958
ActiveWindow.ScrollRow = 963
ActiveWindow.ScrollRow = 969
ActiveWindow.SmallScroll Down:=504
Rows("82:1500").Select
Range("H82").Activate
Selection.Delete Shift:=xlUp
Range("I259").Select
ActiveSheet.ShowAllData
Range("J4").Select
ActiveWindow.ScrollColumn = 7
ActiveWindow.ScrollColumn = 6
ActiveWindow.ScrollColumn = 5
ActiveWindow.ScrollColumn = 4
ActiveWindow.ScrollColumn = 3
ActiveWindow.ScrollColumn = 2
ActiveWindow.ScrollColumn = 1
Columns("A:A").Select
Selection.Insert Shift:=xlToRight, CopyOrigin:=xlFormatFromLeftOrAbove
Columns("I:I").Select
Selection.Insert Shift:=xlToRight, CopyOrigin:=xlFormatFromLeftOrAbove
Columns("H:H").Select
Selection.NumberFormat = "0000"
Columns("H:H").Select
Selection.TextToColumns Destination:=Range("H1"), DataType:=xlFixedWidth, _
FieldInfo:=Array(Array(0, 1), Array(7, 1)), TrailingMinusNumbers:=True
Columns("I:I").Select
Selection.NumberFormat = "0000"
Range("A1").Select
ActiveCell.FormulaR1C1 = "Identifier"
Range("A2").Select
ActiveCell.FormulaR1C1 = "=TEXT(RC[8],""0000"")&""""&RC[3]"
Range("A3").Select
Columns("A:A").EntireColumn.AutoFit
Range("A2").Select
Selection.AutoFill Destination:=Range("A2:A1000"), Type:=xlFillDefault
Range("A2:A1000").Select
ActiveWindow.ScrollRow = 997
ActiveWindow.ScrollRow = 987
ActiveWindow.ScrollRow = 976
ActiveWindow.ScrollRow = 962
ActiveWindow.ScrollRow = 941
ActiveWindow.ScrollRow = 927
ActiveWindow.ScrollRow = 905
ActiveWindow.ScrollRow = 888
ActiveWindow.ScrollRow = 865
ActiveWindow.ScrollRow = 845
ActiveWindow.ScrollRow = 813
ActiveWindow.ScrollRow = 791
ActiveWindow.ScrollRow = 755
ActiveWindow.ScrollRow = 732
ActiveWindow.ScrollRow = 693
ActiveWindow.ScrollRow = 671
ActiveWindow.ScrollRow = 622
ActiveWindow.ScrollRow = 587
ActiveWindow.ScrollRow = 530
ActiveWindow.ScrollRow = 490
ActiveWindow.ScrollRow = 454
ActiveWindow.ScrollRow = 414
ActiveWindow.ScrollRow = 395
ActiveWindow.ScrollRow = 365
ActiveWindow.ScrollRow = 343
ActiveWindow.ScrollRow = 313
ActiveWindow.ScrollRow = 297
ActiveWindow.ScrollRow = 276
ActiveWindow.ScrollRow = 257
ActiveWindow.ScrollRow = 237
ActiveWindow.ScrollRow = 223
ActiveWindow.ScrollRow = 199
ActiveWindow.ScrollRow = 188
ActiveWindow.ScrollRow = 174
ActiveWindow.ScrollRow = 162
ActiveWindow.ScrollRow = 147
ActiveWindow.ScrollRow = 140
ActiveWindow.ScrollRow = 128
ActiveWindow.ScrollRow = 120
ActiveWindow.ScrollRow = 112
ActiveWindow.ScrollRow = 102
ActiveWindow.ScrollRow = 94
ActiveWindow.ScrollRow = 82
ActiveWindow.ScrollRow = 77
ActiveWindow.ScrollRow = 66
ActiveWindow.ScrollRow = 58
ActiveWindow.ScrollRow = 47
ActiveWindow.ScrollRow = 42
ActiveWindow.ScrollRow = 29
ActiveWindow.ScrollRow = 25
ActiveWindow.ScrollRow = 15
ActiveWindow.ScrollRow = 10
ActiveWindow.ScrollRow = 3
ActiveWindow.ScrollRow = 1
Columns("A:A").Select
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Range("A6").Select
Application.CutCopyMode = False
Range("D11").Select
End Sub
Last edited by a moderator: