Copying table to another workbook

Keyss

New Member
Joined
Jul 15, 2018
Messages
13
Hi, i'm a noobie with macros but I need help with the following.

Excel 2010
2 reports, both opened in the same instance of excel

I add information including formulas into workbook 1
I add information and formulas into workbook 2 including adding additional columns to match columns in workbook 1

The trouble I have is when I copy the table from workbook 2 into a position below the table on workbook 1, manually it works fine... but the macro I have been recording will not do it, often giving different results (but generally leaving some information out or the whole sheet can be blank).

I've tried looking this up to find the answer but nothing has helped. Can anybody help please?
 

Excel Facts

What did Pito Salas invent?
Pito Salas, working for Lotus, popularized what would become to be pivot tables. It was released as Lotus Improv in 1989.

PhilS2520

Board Regular
Joined
Mar 12, 2018
Messages
80
Hi keys,

I have a feeling it is all about addressing (relative vs. absolute). Look into that. And be advised the recorder does a good job in generating code. But it is far from perfect. If you want to use VBA, LEARN VBA.
 

NoSparks

Well-known Member
Joined
Mar 15, 2013
Messages
1,051
Office Version
  1. 2010
Platform
  1. Windows
The trouble I have is when I copy the table from workbook 2 into a position below the table on workbook 1, manually it works fine... but the macro I have been recording will not do it, often giving different results (but generally leaving some information out or the whole sheet can be blank).
If you recorded yourself doing it manually, the macro should work.
I think the word 'often' is saying you're running the recorded macro again and again.
A recorded macro is an excellent place to start, but will need 'tuned-up' to be reusable unless the repeated runs are with things exactly the same as when recorded.

To get assistance with the macro you'll need to post it so we know what's going on.
 

Keyss

New Member
Joined
Jul 15, 2018
Messages
13
Hi NoSparks

Thank you for your reply, here is the code where the copy/paste goes wrong

Code:
Sub Macro5()
'
' Macro5 Macro
'


'
    Sheets("usage").Select
    Range("A1:M1").Select
    ActiveWindow.Zoom = 90
    Range("A1:Q500").Select
    Selection.Copy
    Sheets("Export").Select
    Selection.PasteSpecial Paste:=xlPasteFormulas, Operation:=xlNone, _
        SkipBlanks:=False, Transpose:=False
    Range("S11").Select
    ActiveWindow.ScrollRow = 8
    ActiveWindow.ScrollRow = 22
    ActiveWindow.ScrollRow = 37
    ActiveWindow.ScrollRow = 66
    ActiveWindow.ScrollRow = 102
    ActiveWindow.ScrollRow = 132
    ActiveWindow.ScrollRow = 183
    ActiveWindow.ScrollRow = 212
    ActiveWindow.ScrollRow = 255
    ActiveWindow.ScrollRow = 277
    ActiveWindow.ScrollRow = 314
    ActiveWindow.ScrollRow = 328
    ActiveWindow.ScrollRow = 467
    ActiveWindow.ScrollRow = 518
    ActiveWindow.ScrollRow = 554
    ActiveWindow.ScrollRow = 590
    ActiveWindow.ScrollRow = 612
    ActiveWindow.ScrollRow = 656
    ActiveWindow.ScrollRow = 671
    ActiveWindow.ScrollRow = 707
    ActiveWindow.ScrollRow = 722
    ActiveWindow.ScrollRow = 758
    ActiveWindow.ScrollRow = 823
    ActiveWindow.ScrollRow = 838
    ActiveWindow.ScrollRow = 867
    ActiveWindow.ScrollRow = 874
    ActiveWindow.ScrollRow = 904
    ActiveWindow.ScrollRow = 925
    ActiveWindow.ScrollRow = 947
    ActiveWindow.ScrollRow = 962
    ActiveWindow.ScrollRow = 1006
    ActiveWindow.ScrollRow = 1020
    ActiveWindow.ScrollRow = 1042
    ActiveWindow.ScrollRow = 1108
    ActiveWindow.ScrollRow = 1129
    ActiveWindow.ScrollRow = 1144
    ActiveWindow.ScrollRow = 1166
    ActiveWindow.ScrollRow = 1173
    ActiveWindow.ScrollRow = 1202
    ActiveWindow.ScrollRow = 1217
    ActiveWindow.ScrollRow = 1224
    ActiveWindow.ScrollRow = 1239
    ActiveWindow.ScrollRow = 1260
    ActiveWindow.ScrollRow = 1275
    ActiveWindow.ScrollRow = 1290
    ActiveWindow.ScrollRow = 1326
    ActiveWindow.ScrollRow = 1348
    ActiveWindow.ScrollRow = 1370
    ActiveWindow.ScrollRow = 1413
    ActiveWindow.ScrollRow = 1428
    ActiveWindow.ScrollRow = 1494
    ActiveWindow.ScrollRow = 1544
    ActiveWindow.ScrollRow = 1566
    ActiveWindow.ScrollRow = 1617
    ActiveWindow.ScrollRow = 1741
    ActiveWindow.ScrollRow = 1799
    ActiveWindow.ScrollRow = 1887
    ActiveWindow.ScrollRow = 1901
    ActiveWindow.ScrollRow = 1967
    ActiveWindow.ScrollRow = 2011
    ActiveWindow.ScrollRow = 2025
    ActiveWindow.ScrollRow = 2032
    ActiveWindow.ScrollRow = 2040
    ActiveWindow.ScrollRow = 2054
    ActiveWindow.ScrollRow = 2062
    ActiveWindow.ScrollRow = 2069
    ActiveWindow.ScrollRow = 2076
    ActiveWindow.ScrollRow = 2083
    ActiveWindow.ScrollRow = 2098
    ActiveWindow.ScrollRow = 2113
    ActiveWindow.ScrollRow = 2127
    ActiveWindow.ScrollRow = 2149
    ActiveWindow.ScrollRow = 2164
    ActiveWindow.ScrollRow = 2178
    ActiveWindow.ScrollRow = 2200
    ActiveWindow.ScrollRow = 2207
    ActiveWindow.ScrollRow = 2236
    ActiveWindow.ScrollRow = 2251
    ActiveWindow.ScrollRow = 2280
    ActiveWindow.ScrollRow = 2353
    ActiveWindow.ScrollRow = 2389
    ActiveWindow.ScrollRow = 2411
    ActiveWindow.ScrollRow = 2448
    ActiveWindow.ScrollRow = 2520
    ActiveWindow.ScrollRow = 2557
    ActiveWindow.ScrollRow = 2586
    ActiveWindow.ScrollRow = 2615
    ActiveWindow.ScrollRow = 2673
    ActiveWindow.ScrollRow = 2732
    ActiveWindow.ScrollRow = 2753
    ActiveWindow.ScrollRow = 2804
    ActiveWindow.ScrollRow = 2819
    ActiveWindow.ScrollRow = 2834
    ActiveWindow.ScrollRow = 2855
    ActiveWindow.ScrollRow = 2870
    ActiveWindow.ScrollRow = 2899
    ActiveWindow.ScrollRow = 2914
    ActiveWindow.ScrollRow = 2921
    ActiveWindow.ScrollRow = 2943
    ActiveWindow.ScrollRow = 2957
    ActiveWindow.ScrollRow = 2972
    ActiveWindow.ScrollRow = 3001
    ActiveWindow.ScrollRow = 3008
    ActiveWindow.ScrollRow = 3023
    ActiveWindow.ScrollRow = 3030
    ActiveWindow.ScrollRow = 3052
    ActiveWindow.ScrollRow = 3067
    ActiveWindow.ScrollRow = 3088
    ActiveWindow.ScrollRow = 3125
    ActiveWindow.ScrollRow = 3139
    ActiveWindow.ScrollRow = 3183
    ActiveWindow.ScrollRow = 3205
    ActiveWindow.ScrollRow = 3263
    ActiveWindow.ScrollRow = 3307
    ActiveWindow.ScrollRow = 3372
    ActiveWindow.ScrollRow = 3409
    ActiveWindow.ScrollRow = 3584
    ActiveWindow.ScrollRow = 3620
    ActiveWindow.ScrollRow = 3700
    ActiveWindow.ScrollRow = 3766
    ActiveWindow.ScrollRow = 3795
    ActiveWindow.ScrollRow = 3809
    ActiveWindow.ScrollRow = 3846
    ActiveWindow.ScrollRow = 3860
    ActiveWindow.ScrollRow = 3919
    ActiveWindow.ScrollRow = 3948
    ActiveWindow.ScrollRow = 3962
    ActiveWindow.ScrollRow = 3999
    ActiveWindow.ScrollRow = 4043
    ActiveWindow.ScrollRow = 4064
    ActiveWindow.ScrollRow = 4108
    ActiveWindow.ScrollRow = 4115
    ActiveWindow.ScrollRow = 4144
    ActiveWindow.ScrollRow = 4152
    ActiveWindow.ScrollRow = 4174
    ActiveWindow.ScrollRow = 4181
    ActiveWindow.ScrollRow = 4203
    ActiveWindow.ScrollRow = 4210
    ActiveWindow.ScrollRow = 4225
    ActiveWindow.ScrollRow = 4232
    ActiveWindow.ScrollRow = 4246
    ActiveWindow.ScrollRow = 4254
    ActiveWindow.ScrollRow = 4268
    ActiveWindow.ScrollRow = 4276
    ActiveWindow.ScrollRow = 4297
    ActiveWindow.ScrollRow = 4312
    ActiveWindow.ScrollRow = 4327
    ActiveWindow.ScrollRow = 4334
    ActiveWindow.ScrollRow = 4356
    ActiveWindow.ScrollRow = 4370
    ActiveWindow.ScrollRow = 4392
    ActiveWindow.ScrollRow = 4399
    ActiveWindow.ScrollRow = 4414
    ActiveWindow.ScrollRow = 4429
    ActiveWindow.ScrollRow = 4450
    ActiveWindow.ScrollRow = 4465
    ActiveWindow.ScrollRow = 4479
    ActiveWindow.ScrollRow = 4487
    ActiveWindow.ScrollRow = 4501
    ActiveWindow.ScrollRow = 4516
    ActiveWindow.ScrollRow = 4538
    ActiveWindow.ScrollRow = 4545
    ActiveWindow.ScrollRow = 4567
    ActiveWindow.ScrollRow = 4581
    ActiveWindow.ScrollRow = 4603
    ActiveWindow.ScrollRow = 4618
    ActiveWindow.ScrollRow = 4640
    ActiveWindow.ScrollRow = 4647
    ActiveWindow.ScrollRow = 4654
    ActiveWindow.ScrollRow = 4669
    ActiveWindow.ScrollRow = 4676
    ActiveWindow.ScrollRow = 4683
    ActiveWindow.ScrollRow = 4698
    ActiveWindow.ScrollRow = 4705
    ActiveWindow.ScrollRow = 4713
    ActiveWindow.ScrollRow = 4727
    ActiveWindow.ScrollRow = 4749
    ActiveWindow.ScrollRow = 4771
    ActiveWindow.ScrollRow = 4778
    ActiveWindow.ScrollRow = 4800
    ActiveWindow.ScrollRow = 4815
    ActiveWindow.ScrollRow = 4836
    ActiveWindow.ScrollRow = 4858
    ActiveWindow.ScrollRow = 4865
    ActiveWindow.ScrollRow = 4873
    ActiveWindow.ScrollRow = 4880
    ActiveWindow.ScrollRow = 4887
    ActiveWindow.ScrollRow = 4902
    ActiveWindow.ScrollRow = 4909
    ActiveWindow.ScrollRow = 4916
    ActiveWindow.ScrollRow = 4924
    ActiveWindow.ScrollRow = 4931
    ActiveWindow.ScrollRow = 4938
    ActiveWindow.ScrollRow = 4946
    ActiveWindow.ScrollRow = 4953
    ActiveWindow.ScrollRow = 4960
    ActiveWindow.ScrollRow = 4967
    ActiveWindow.ScrollRow = 4975
    ActiveWindow.ScrollRow = 4982
    ActiveWindow.ScrollRow = 4989
    ActiveWindow.ScrollRow = 4997
    ActiveWindow.ScrollRow = 5004
    ActiveWindow.ScrollRow = 5011
    ActiveWindow.ScrollRow = 5018
    ActiveWindow.ScrollRow = 5026
    ActiveWindow.ScrollRow = 5033
    ActiveWindow.ScrollRow = 5040
    ActiveWindow.ScrollRow = 5048
    ActiveWindow.ScrollRow = 5055
    ActiveWindow.ScrollRow = 5062
    ActiveWindow.ScrollRow = 5069
    ActiveWindow.ScrollRow = 5077
    ActiveWindow.ScrollRow = 5084
    ActiveWindow.ScrollRow = 5091
    ActiveWindow.ScrollRow = 5099
    ActiveWindow.ScrollRow = 5106
    ActiveWindow.ScrollRow = 5091
    ActiveWindow.ScrollRow = 5069
    ActiveWindow.ScrollRow = 5062
    ActiveWindow.ScrollRow = 5055
    ActiveWindow.ScrollRow = 5040
    ActiveWindow.ScrollRow = 5026
    ActiveWindow.ScrollRow = 5018
    ActiveWindow.ScrollRow = 5011
    ActiveWindow.ScrollRow = 5004
    ActiveWindow.ScrollRow = 4997
    ActiveWindow.ScrollRow = 4982
    ActiveWindow.ScrollRow = 4975
    ActiveWindow.ScrollRow = 4967
    ActiveWindow.ScrollRow = 4953
    ActiveWindow.ScrollRow = 4938
    ActiveWindow.ScrollRow = 4909
    ActiveWindow.ScrollRow = 4895
    ActiveWindow.ScrollRow = 4851
    ActiveWindow.ScrollRow = 4800
    ActiveWindow.ScrollRow = 4778
    ActiveWindow.ScrollRow = 4654
    ActiveWindow.ScrollRow = 4632
    ActiveWindow.ScrollRow = 4581
    ActiveWindow.ScrollRow = 4516
    ActiveWindow.ScrollRow = 4494
    ActiveWindow.ScrollRow = 4479
    ActiveWindow.ScrollRow = 4450
    ActiveWindow.ScrollRow = 4407
    ActiveWindow.ScrollRow = 4392
    ActiveWindow.ScrollRow = 4348
    ActiveWindow.ScrollRow = 4327
    ActiveWindow.ScrollRow = 4290
    ActiveWindow.ScrollRow = 4188
    ActiveWindow.ScrollRow = 4144
    ActiveWindow.ScrollRow = 4086
    ActiveWindow.ScrollRow = 3977
    ActiveWindow.ScrollRow = 3948
    ActiveWindow.ScrollRow = 3890
    ActiveWindow.ScrollRow = 3788
    ActiveWindow.ScrollRow = 3737
    ActiveWindow.ScrollRow = 3620
    ActiveWindow.ScrollRow = 3569
    ActiveWindow.ScrollRow = 3547
    ActiveWindow.ScrollRow = 3504
    ActiveWindow.ScrollRow = 3482
    ActiveWindow.ScrollRow = 3445
    ActiveWindow.ScrollRow = 3423
    ActiveWindow.ScrollRow = 3380
    ActiveWindow.ScrollRow = 3300
    ActiveWindow.ScrollRow = 3285
    ActiveWindow.ScrollRow = 3212
    ActiveWindow.ScrollRow = 3176
    ActiveWindow.ScrollRow = 2957
    ActiveWindow.ScrollRow = 2855
    ActiveWindow.ScrollRow = 2797
    ActiveWindow.ScrollRow = 2688
    ActiveWindow.ScrollRow = 2637
    ActiveWindow.ScrollRow = 2571
    ActiveWindow.ScrollRow = 2513
    ActiveWindow.ScrollRow = 2491
    ActiveWindow.ScrollRow = 2448
    ActiveWindow.ScrollRow = 2353
    ActiveWindow.ScrollRow = 2331
    ActiveWindow.ScrollRow = 2280
    ActiveWindow.ScrollRow = 2258
    ActiveWindow.ScrollRow = 2207
    ActiveWindow.ScrollRow = 2134
    ActiveWindow.ScrollRow = 2113
    ActiveWindow.ScrollRow = 2069
    ActiveWindow.ScrollRow = 2018
    ActiveWindow.ScrollRow = 1989
    ActiveWindow.ScrollRow = 1952
    ActiveWindow.ScrollRow = 1938
    ActiveWindow.ScrollRow = 1879
    ActiveWindow.ScrollRow = 1850
    ActiveWindow.ScrollRow = 1836
    ActiveWindow.ScrollRow = 1814
    ActiveWindow.ScrollRow = 1799
    ActiveWindow.ScrollRow = 1748
    ActiveWindow.ScrollRow = 1719
    ActiveWindow.ScrollRow = 1712
    ActiveWindow.ScrollRow = 1690
    ActiveWindow.ScrollRow = 1676
    ActiveWindow.ScrollRow = 1632
    ActiveWindow.ScrollRow = 1603
    ActiveWindow.ScrollRow = 1588
    ActiveWindow.ScrollRow = 1566
    ActiveWindow.ScrollRow = 1544
    ActiveWindow.ScrollRow = 1515
    ActiveWindow.ScrollRow = 1501
    ActiveWindow.ScrollRow = 1479
    ActiveWindow.ScrollRow = 1472
    ActiveWindow.ScrollRow = 1450
    ActiveWindow.ScrollRow = 1443
    ActiveWindow.ScrollRow = 1421
    ActiveWindow.ScrollRow = 1399
    ActiveWindow.ScrollRow = 1392
    ActiveWindow.ScrollRow = 1370
    ActiveWindow.ScrollRow = 1355
    ActiveWindow.ScrollRow = 1333
    ActiveWindow.ScrollRow = 1319
    ActiveWindow.ScrollRow = 1297
    ActiveWindow.ScrollRow = 1268
    ActiveWindow.ScrollRow = 1260
    ActiveWindow.ScrollRow = 1231
    ActiveWindow.ScrollRow = 1217
    ActiveWindow.ScrollRow = 1180
    ActiveWindow.ScrollRow = 1158
    ActiveWindow.ScrollRow = 1115
    ActiveWindow.ScrollRow = 1086
    ActiveWindow.ScrollRow = 1042
    ActiveWindow.ScrollRow = 991
    ActiveWindow.ScrollRow = 969
    ActiveWindow.ScrollRow = 925
    ActiveWindow.ScrollRow = 911
    ActiveWindow.ScrollRow = 860
    ActiveWindow.ScrollRow = 823
    ActiveWindow.ScrollRow = 802
    ActiveWindow.ScrollRow = 758
    ActiveWindow.ScrollRow = 722
    ActiveWindow.ScrollRow = 700
    ActiveWindow.ScrollRow = 685
    ActiveWindow.ScrollRow = 671
    ActiveWindow.ScrollRow = 649
    ActiveWindow.ScrollRow = 620
    ActiveWindow.ScrollRow = 612
    ActiveWindow.ScrollRow = 598
    ActiveWindow.ScrollRow = 583
    ActiveWindow.ScrollRow = 576
    ActiveWindow.ScrollRow = 561
    ActiveWindow.ScrollRow = 554
    ActiveWindow.ScrollRow = 547
    ActiveWindow.ScrollRow = 532
    ActiveWindow.ScrollRow = 518
    ActiveWindow.ScrollRow = 510
    ActiveWindow.ScrollRow = 488
    ActiveWindow.ScrollRow = 481
    ActiveWindow.ScrollRow = 452
    ActiveWindow.ScrollRow = 437
    ActiveWindow.ScrollRow = 408
    ActiveWindow.ScrollRow = 394
    ActiveWindow.ScrollRow = 372
    ActiveWindow.ScrollRow = 365
    ActiveWindow.ScrollRow = 343
    ActiveWindow.ScrollRow = 328
    ActiveWindow.ScrollRow = 306
    ActiveWindow.ScrollRow = 292
    ActiveWindow.ScrollRow = 277
    ActiveWindow.ScrollRow = 270
    ActiveWindow.ScrollRow = 263
    ActiveWindow.ScrollRow = 241
    ActiveWindow.ScrollRow = 234
    ActiveWindow.ScrollRow = 219
    ActiveWindow.ScrollRow = 212
    ActiveWindow.ScrollRow = 204
    ActiveWindow.ScrollRow = 197
    ActiveWindow.ScrollRow = 183
    ActiveWindow.ScrollRow = 175
    ActiveWindow.ScrollRow = 168
    ActiveWindow.ScrollRow = 153
    ActiveWindow.ScrollRow = 146
    ActiveWindow.ScrollRow = 139
    ActiveWindow.ScrollRow = 124
    ActiveWindow.ScrollRow = 102
    ActiveWindow.ScrollRow = 95
    ActiveWindow.ScrollRow = 66
    ActiveWindow.ScrollRow = 44
    ActiveWindow.ScrollRow = 30
    ActiveWindow.ScrollRow = 1
    Application.CutCopyMode = False
    ActiveWorkbook.Save
    Columns("A:A").Select
    Selection.EntireRow.Delete
    ActiveWindow.ScrollRow = 5194
    ActiveWindow.ScrollRow = 5180
    ActiveWindow.ScrollRow = 5165
    ActiveWindow.ScrollRow = 5114
    ActiveWindow.ScrollRow = 5078
    ActiveWindow.ScrollRow = 5056
    ActiveWindow.ScrollRow = 5019
    ActiveWindow.ScrollRow = 4998
    ActiveWindow.ScrollRow = 4852
    ActiveWindow.ScrollRow = 4801
    ActiveWindow.ScrollRow = 4779
    ActiveWindow.ScrollRow = 4728
    ActiveWindow.ScrollRow = 4662
    ActiveWindow.ScrollRow = 4611
    ActiveWindow.ScrollRow = 4371
    ActiveWindow.ScrollRow = 4291
    ActiveWindow.ScrollRow = 4240
    ActiveWindow.ScrollRow = 4138
    ActiveWindow.ScrollRow = 4094
    ActiveWindow.ScrollRow = 4021
    ActiveWindow.ScrollRow = 3949
    ActiveWindow.ScrollRow = 3883
    ActiveWindow.ScrollRow = 3876
    ActiveWindow.ScrollRow = 3832
    ActiveWindow.ScrollRow = 3803
    ActiveWindow.ScrollRow = 3788
    ActiveWindow.ScrollRow = 3766
    ActiveWindow.ScrollRow = 3745
    ActiveWindow.ScrollRow = 3672
    ActiveWindow.ScrollRow = 3657
    ActiveWindow.ScrollRow = 3635
    ActiveWindow.ScrollRow = 3621
    ActiveWindow.ScrollRow = 3599
    ActiveWindow.ScrollRow = 3584
    ActiveWindow.ScrollRow = 3570
    ActiveWindow.ScrollRow = 3555
    ActiveWindow.ScrollRow = 3533
    ActiveWindow.ScrollRow = 3526
    ActiveWindow.ScrollRow = 3504
    ActiveWindow.ScrollRow = 3490
    ActiveWindow.ScrollRow = 3475
    ActiveWindow.ScrollRow = 3446
    ActiveWindow.ScrollRow = 3431
    ActiveWindow.ScrollRow = 3410
    ActiveWindow.ScrollRow = 3388
    ActiveWindow.ScrollRow = 3373
    ActiveWindow.ScrollRow = 3351
    ActiveWindow.ScrollRow = 3337
    ActiveWindow.ScrollRow = 3322
    ActiveWindow.ScrollRow = 3308
    ActiveWindow.ScrollRow = 3286
    ActiveWindow.ScrollRow = 3278
    ActiveWindow.ScrollRow = 3242
    ActiveWindow.ScrollRow = 3227
    ActiveWindow.ScrollRow = 3198
    ActiveWindow.ScrollRow = 3184
    ActiveWindow.ScrollRow = 3162
    ActiveWindow.ScrollRow = 3104
    ActiveWindow.ScrollRow = 3089
    ActiveWindow.ScrollRow = 3053
    ActiveWindow.ScrollRow = 3038
    ActiveWindow.ScrollRow = 3009
    ActiveWindow.ScrollRow = 2965
    ActiveWindow.ScrollRow = 2922
    ActiveWindow.ScrollRow = 2907
    ActiveWindow.ScrollRow = 2871
    ActiveWindow.ScrollRow = 2841
    ActiveWindow.ScrollRow = 2834
    ActiveWindow.ScrollRow = 2820
    ActiveWindow.ScrollRow = 2805
    ActiveWindow.ScrollRow = 2783
    ActiveWindow.ScrollRow = 2769
    ActiveWindow.ScrollRow = 2739
    ActiveWindow.ScrollRow = 2732
    ActiveWindow.ScrollRow = 2710
    ActiveWindow.ScrollRow = 2696
    ActiveWindow.ScrollRow = 2674
    ActiveWindow.ScrollRow = 2659
    ActiveWindow.ScrollRow = 2645
    ActiveWindow.ScrollRow = 2630
    ActiveWindow.ScrollRow = 2623
    ActiveWindow.ScrollRow = 2616
    ActiveWindow.ScrollRow = 2608
    ActiveWindow.ScrollRow = 2594
    ActiveWindow.ScrollRow = 2586
    ActiveWindow.ScrollRow = 2579
    ActiveWindow.ScrollRow = 2572
    ActiveWindow.ScrollRow = 2557
    ActiveWindow.ScrollRow = 2550
    ActiveWindow.ScrollRow = 2535
    ActiveWindow.ScrollRow = 2528
    ActiveWindow.ScrollRow = 2514
    ActiveWindow.ScrollRow = 2499
    ActiveWindow.ScrollRow = 2492
    ActiveWindow.ScrollRow = 2477
    ActiveWindow.ScrollRow = 2470
    ActiveWindow.ScrollRow = 2463
    ActiveWindow.ScrollRow = 2448
    ActiveWindow.ScrollRow = 2441
    ActiveWindow.ScrollRow = 2433
    ActiveWindow.ScrollRow = 2426
    ActiveWindow.ScrollRow = 2419
    ActiveWindow.ScrollRow = 2412
    ActiveWindow.ScrollRow = 2404
    ActiveWindow.ScrollRow = 2397
    ActiveWindow.ScrollRow = 2382
    ActiveWindow.ScrollRow = 2375
    ActiveWindow.ScrollRow = 2361
    ActiveWindow.ScrollRow = 2353
    ActiveWindow.ScrollRow = 2346
    ActiveWindow.ScrollRow = 2339
    ActiveWindow.ScrollRow = 2331
    ActiveWindow.ScrollRow = 2324
    ActiveWindow.ScrollRow = 2310
    ActiveWindow.ScrollRow = 2302
    ActiveWindow.ScrollRow = 2295
    ActiveWindow.ScrollRow = 2288
    ActiveWindow.ScrollRow = 2273
    ActiveWindow.ScrollRow = 2259
    ActiveWindow.ScrollRow = 2251
    ActiveWindow.ScrollRow = 2244
    ActiveWindow.ScrollRow = 2237
    ActiveWindow.ScrollRow = 2222
    ActiveWindow.ScrollRow = 2208
    ActiveWindow.ScrollRow = 2200
    ActiveWindow.ScrollRow = 2193
    ActiveWindow.ScrollRow = 2186
    ActiveWindow.ScrollRow = 2171
    ActiveWindow.ScrollRow = 2157
    ActiveWindow.ScrollRow = 2149
    ActiveWindow.ScrollRow = 2142
    ActiveWindow.ScrollRow = 2135
    ActiveWindow.ScrollRow = 2128
    ActiveWindow.ScrollRow = 2113
    ActiveWindow.ScrollRow = 2106
    ActiveWindow.ScrollRow = 2098
    ActiveWindow.ScrollRow = 2091
    ActiveWindow.ScrollRow = 2084
    ActiveWindow.ScrollRow = 2077
    ActiveWindow.ScrollRow = 2062
    ActiveWindow.ScrollRow = 2047
    ActiveWindow.ScrollRow = 2026
    ActiveWindow.ScrollRow = 2018
    ActiveWindow.ScrollRow = 1953
    ActiveWindow.ScrollRow = 1924
    ActiveWindow.ScrollRow = 1916
    ActiveWindow.ScrollRow = 1865
    ActiveWindow.ScrollRow = 1851
    ActiveWindow.ScrollRow = 1792
    ActiveWindow.ScrollRow = 1756
    ActiveWindow.ScrollRow = 1727
    ActiveWindow.ScrollRow = 1654
    ActiveWindow.ScrollRow = 1603
    ActiveWindow.ScrollRow = 1487
    ActiveWindow.ScrollRow = 1370
    ActiveWindow.ScrollRow = 1326
    ActiveWindow.ScrollRow = 1319
    ActiveWindow.ScrollRow = 1312
    ActiveWindow.ScrollRow = 1304
    ActiveWindow.ScrollRow = 1290
    ActiveWindow.ScrollRow = 1283
    ActiveWindow.ScrollRow = 1275
    ActiveWindow.ScrollRow = 1268
    ActiveWindow.ScrollRow = 1261
    ActiveWindow.ScrollRow = 1253
    ActiveWindow.ScrollRow = 1246
    ActiveWindow.ScrollRow = 1239
    ActiveWindow.ScrollRow = 1232
    ActiveWindow.ScrollRow = 1224
    ActiveWindow.ScrollRow = 1210
    ActiveWindow.ScrollRow = 1202
    ActiveWindow.ScrollRow = 1188
    ActiveWindow.ScrollRow = 1173
    ActiveWindow.ScrollRow = 1166
    ActiveWindow.ScrollRow = 1159
    ActiveWindow.ScrollRow = 1151
    ActiveWindow.ScrollRow = 1144
    ActiveWindow.ScrollRow = 1137
    ActiveWindow.ScrollRow = 1130
    ActiveWindow.ScrollRow = 1122
    ActiveWindow.ScrollRow = 1115
    ActiveWindow.ScrollRow = 1108
    ActiveWindow.ScrollRow = 1100
    ActiveWindow.ScrollRow = 1093
    ActiveWindow.ScrollRow = 1086
    ActiveWindow.ScrollRow = 1079
    ActiveWindow.ScrollRow = 1071
    ActiveWindow.ScrollRow = 1064
    ActiveWindow.ScrollRow = 1057
    ActiveWindow.ScrollRow = 1049
    ActiveWindow.ScrollRow = 1042
    ActiveWindow.ScrollRow = 1035
    ActiveWindow.ScrollRow = 1028
    ActiveWindow.ScrollRow = 1020
    ActiveWindow.ScrollRow = 1013
    ActiveWindow.ScrollRow = 1006
    ActiveWindow.ScrollRow = 998
    ActiveWindow.ScrollRow = 991
    ActiveWindow.ScrollRow = 984
    ActiveWindow.ScrollRow = 977
    ActiveWindow.ScrollRow = 969
    ActiveWindow.ScrollRow = 962
    ActiveWindow.ScrollRow = 955
    ActiveWindow.ScrollRow = 947
    ActiveWindow.ScrollRow = 940
    ActiveWindow.ScrollRow = 933
    ActiveWindow.ScrollRow = 918
    ActiveWindow.ScrollRow = 911
    ActiveWindow.ScrollRow = 904
    ActiveWindow.ScrollRow = 896
    ActiveWindow.ScrollRow = 889
    ActiveWindow.ScrollRow = 882
    ActiveWindow.ScrollRow = 875
    ActiveWindow.ScrollRow = 860
    ActiveWindow.ScrollRow = 853
    ActiveWindow.ScrollRow = 845
    ActiveWindow.ScrollRow = 838
    ActiveWindow.ScrollRow = 831
    ActiveWindow.ScrollRow = 824
    ActiveWindow.ScrollRow = 816
    ActiveWindow.ScrollRow = 809
    ActiveWindow.ScrollRow = 802
    ActiveWindow.ScrollRow = 794
    ActiveWindow.ScrollRow = 787
    ActiveWindow.ScrollRow = 780
    ActiveWindow.ScrollRow = 773
    ActiveWindow.ScrollRow = 765
    ActiveWindow.ScrollRow = 758
    ActiveWindow.ScrollRow = 751
    ActiveWindow.ScrollRow = 744
    ActiveWindow.ScrollRow = 736
    ActiveWindow.ScrollRow = 729
    ActiveWindow.ScrollRow = 722
    ActiveWindow.ScrollRow = 714
    ActiveWindow.ScrollRow = 707
    ActiveWindow.ScrollRow = 700
    ActiveWindow.ScrollRow = 693
    ActiveWindow.ScrollRow = 685
    ActiveWindow.ScrollRow = 678
    ActiveWindow.ScrollRow = 671
    ActiveWindow.ScrollRow = 663
    ActiveWindow.ScrollRow = 656
    ActiveWindow.ScrollRow = 649
    ActiveWindow.ScrollRow = 642
    ActiveWindow.ScrollRow = 634
    ActiveWindow.ScrollRow = 627
    ActiveWindow.ScrollRow = 620
    ActiveWindow.ScrollRow = 612
    ActiveWindow.ScrollRow = 605
    ActiveWindow.ScrollRow = 598
    ActiveWindow.ScrollRow = 591
    ActiveWindow.ScrollRow = 583
    ActiveWindow.ScrollRow = 576
    ActiveWindow.ScrollRow = 569
    ActiveWindow.ScrollRow = 561
    ActiveWindow.ScrollRow = 554
    ActiveWindow.ScrollRow = 547
    ActiveWindow.ScrollRow = 540
    ActiveWindow.ScrollRow = 532
    ActiveWindow.ScrollRow = 525
    ActiveWindow.ScrollRow = 518
    ActiveWindow.ScrollRow = 510
    ActiveWindow.ScrollRow = 503
    ActiveWindow.ScrollRow = 496
    ActiveWindow.ScrollRow = 489
    ActiveWindow.ScrollRow = 481
    ActiveWindow.ScrollRow = 474
    ActiveWindow.ScrollRow = 467
    ActiveWindow.ScrollRow = 459
    ActiveWindow.ScrollRow = 452
    ActiveWindow.ScrollRow = 445
    ActiveWindow.ScrollRow = 438
    ActiveWindow.ScrollRow = 430
    ActiveWindow.ScrollRow = 423
    ActiveWindow.ScrollRow = 416
    ActiveWindow.ScrollRow = 408
    ActiveWindow.ScrollRow = 401
    ActiveWindow.ScrollRow = 394
    ActiveWindow.ScrollRow = 387
    ActiveWindow.ScrollRow = 379
    ActiveWindow.ScrollRow = 372
    ActiveWindow.ScrollRow = 365
    ActiveWindow.ScrollRow = 357
    ActiveWindow.ScrollRow = 350
    ActiveWindow.ScrollRow = 343
    ActiveWindow.ScrollRow = 336
    ActiveWindow.ScrollRow = 328
    ActiveWindow.ScrollRow = 321
    ActiveWindow.ScrollRow = 314
    ActiveWindow.ScrollRow = 306
    ActiveWindow.ScrollRow = 299
    ActiveWindow.ScrollRow = 292
    ActiveWindow.ScrollRow = 285
    ActiveWindow.ScrollRow = 277
    ActiveWindow.ScrollRow = 270
    ActiveWindow.ScrollRow = 263
    ActiveWindow.ScrollRow = 255
    ActiveWindow.ScrollRow = 248
    ActiveWindow.ScrollRow = 241
    ActiveWindow.ScrollRow = 234
    ActiveWindow.ScrollRow = 226
    ActiveWindow.ScrollRow = 212
    ActiveWindow.ScrollRow = 204
    ActiveWindow.ScrollRow = 197
    ActiveWindow.ScrollRow = 190
    ActiveWindow.ScrollRow = 183
    ActiveWindow.ScrollRow = 175
    ActiveWindow.ScrollRow = 168
    ActiveWindow.ScrollRow = 161
    ActiveWindow.ScrollRow = 153
    ActiveWindow.ScrollRow = 146
    ActiveWindow.ScrollRow = 139
    ActiveWindow.ScrollRow = 132
    ActiveWindow.ScrollRow = 124
    ActiveWindow.ScrollRow = 117
    ActiveWindow.ScrollRow = 110
    ActiveWindow.ScrollRow = 102
    ActiveWindow.ScrollRow = 95
    ActiveWindow.ScrollRow = 88
    ActiveWindow.ScrollRow = 81
    ActiveWindow.ScrollRow = 73
    ActiveWindow.ScrollRow = 66
    ActiveWindow.ScrollRow = 59
    ActiveWindow.ScrollRow = 51
    ActiveWindow.ScrollRow = 44
    ActiveWindow.ScrollRow = 37
    ActiveWindow.ScrollRow = 30
    ActiveWindow.ScrollRow = 22
    ActiveWindow.ScrollRow = 15
    ActiveWindow.ScrollRow = 8
    ActiveWindow.ScrollRow = 1
    Windows("Macro test.xlsm").Activate
End Sub

I appreciate any assistance.
 
Last edited by a moderator:

NoSparks

Well-known Member
Joined
Mar 15, 2013
Messages
1,051
Office Version
  1. 2010
Platform
  1. Windows
The copy-paste part of the code you've posted can be reduced to
Code:
Sheets("usage").Range("A1:Q500").Copy
Sheets("Export").PasteSpecial Paste:=xlPasteFormulas, Operation:=xlNone, _
    SkipBlanks:=False, Transpose:=False
but that will paste to where ever the active cell is on the Export sheet. (S11 ?)
To paste to the next blank row, try like this
Code:
Sheets("usage").Range("A1:Q500").Copy

With Sheets("Export")
    .Select     'to make this the active sheet to satisfy the remainder of your code
    pasteRow = .Cells.Find(What:="*", SearchDirection:=xlPrevious, SearchOrder:=xlByRows).Row + 1
    .Range("A" & pasteRow).PasteSpecial Paste:=xlPasteFormulas, Operation:=xlNone, SkipBlanks:=False, Transpose:=False
End With

None of those ActiveWindow.ScrollRow 's are needed.
 

Keyss

New Member
Joined
Jul 15, 2018
Messages
13
Hi NoSparks

I knew there would be easier coding. All help has been appreciated.

Thank you very much. :)
 

Watch MrExcel Video

Forum statistics

Threads
1,129,466
Messages
5,636,440
Members
416,919
Latest member
twc2c

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top