ActiveSheet. Paste error

Thembela01

New Member
Joined
Jun 7, 2013
Messages
36
Office Version
  1. 2016
Platform
  1. Windows
Hi ,

I have downloaded data and wrote a formula to compare data that is sitting in two columns and hopefully find unique values. I recorded a macro and now my macro is giving me an ActiveSheet.Paste errror. Please check the error i put a Strike-Through.

Heres the code below
VBA Code:
Columns("A:C").Select
    Selection.NumberFormat = "@"
    Range("A1").Select
    ActiveSheet.Paste
    Columns("C:C").Select
    Selection.Cut
    Range("A1").Select
    ActiveSheet.Paste
    Rows("1:3").Select
    Selection.Delete Shift:=xlUp
    Range("C2").Select
    Columns("C:H").Select
    Selection.NumberFormat = "@"
    Range("C2").Select
 [S]   ActiveSheet.Paste[/S]
    Columns("E:E").Select
    Selection.Cut
    Range("C1").Select
    ActiveSheet.Paste
    Range("C1:C4").Select
    Selection.Delete Shift:=xlUp
    Columns("B:B").Select
    Selection.NumberFormat = "General"
    Range("B3").Select
    ActiveCell.FormulaR1C1 = "=TRIM(RC[-1])"
    Range("B3").Select
    Selection.AutoFill Destination:=Range("B3:B4628")
    Range("B3:B4628").Select
    Columns("B:B").Select
    Selection.Copy
    Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
        :=False, Transpose:=False
    Columns("A:A").Select
    Application.CutCopyMode = False
    Selection.Delete Shift:=xlToLeft
    Range("A1").Select
    ActiveCell.FormulaR1C1 = "SOLMAN"
    Columns("C:C").Select
    Selection.NumberFormat = "General"
    Range("C3").Select
    ActiveCell.FormulaR1C1 = "=TRIM(RC[-1])"
    Range("C3").Select
    Selection.AutoFill Destination:=Range("C3:C4")
    Range("C3:C4").Select
    Selection.AutoFill Destination:=Range("C3:C5")
    Range("C3:C5").Select
    Selection.AutoFill Destination:=Range("C3:C5110"), Type:=xlFillDefault
    Range("C3:C5110").Select
    ActiveWindow.ScrollRow = 5056
    ActiveWindow.ScrollRow = 5015
    ActiveWindow.ScrollRow = 4964
    ActiveWindow.ScrollRow = 4852
    ActiveWindow.ScrollRow = 4770
    ActiveWindow.ScrollRow = 4607
    ActiveWindow.ScrollRow = 4525
    ActiveWindow.ScrollRow = 4361
    ActiveWindow.ScrollRow = 4239
    ActiveWindow.ScrollRow = 4075
    ActiveWindow.ScrollRow = 3912
    ActiveWindow.ScrollRow = 3728
    ActiveWindow.ScrollRow = 3401
    ActiveWindow.ScrollRow = 3258
    ActiveWindow.ScrollRow = 3095
    ActiveWindow.ScrollRow = 2942
    ActiveWindow.ScrollRow = 2778
    ActiveWindow.ScrollRow = 2625
    ActiveWindow.ScrollRow = 2462
    ActiveWindow.ScrollRow = 2278
    ActiveWindow.ScrollRow = 2155
    ActiveWindow.ScrollRow = 2002
    ActiveWindow.ScrollRow = 1859
    ActiveWindow.ScrollRow = 1757
    ActiveWindow.ScrollRow = 1655
    ActiveWindow.ScrollRow = 1553
    ActiveWindow.ScrollRow = 1441
    ActiveWindow.ScrollRow = 1338
    ActiveWindow.ScrollRow = 1195
    ActiveWindow.ScrollRow = 1093
    ActiveWindow.ScrollRow = 1022
    ActiveWindow.ScrollRow = 920
    ActiveWindow.ScrollRow = 838
    ActiveWindow.ScrollRow = 766
    ActiveWindow.ScrollRow = 685
    ActiveWindow.ScrollRow = 603
    ActiveWindow.ScrollRow = 491
    ActiveWindow.ScrollRow = 389
    ActiveWindow.ScrollRow = 307
    ActiveWindow.ScrollRow = 184
    ActiveWindow.ScrollRow = 113
    ActiveWindow.ScrollRow = 52
    ActiveWindow.ScrollRow = 1
    Columns("C:C").Select
    Selection.Copy
    Selection.PasteSpecial Paste:=xlPasteFormulas, Operation:=xlNone, _
        SkipBlanks:=False, Transpose:=False
    Application.CutCopyMode = False
    Selection.Cut
    Columns("B:B").Select
    Application.CutCopyMode = False
    Columns("C:C").Select
    Application.CutCopyMode = False
    Selection.Copy
    Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
        :=False, Transpose:=False
    Columns("B:B").Select
    Application.CutCopyMode = False
    Selection.Delete Shift:=xlToLeft
    Range("B1").Select
    ActiveCell.FormulaR1C1 = "THP"
    Columns("D:E").Select
    Selection.NumberFormat = "General"
    Range("D1").Select
    ActiveCell.FormulaR1C1 = "NOT IN SOLMAN"
    Range("D2").Select
    Columns("D:D").EntireColumn.AutoFit
    Range("E1").Select
    Selection.NumberFormat = "General"
    ActiveCell.FormulaR1C1 = "NOT IN THP"
    Range("D3").Select
    ActiveCell.FormulaR1C1 = "=IF(COUNTIF(C[-2],RC[-3])=0,RC[-3],"""")"
    Range("D3").Select
    Selection.AutoFill Destination:=Range("D3:D5110"), Type:=xlFillDefault
    Range("D3:D5110").Select
    ActiveWindow.ScrollRow = 5056
    ActiveWindow.ScrollRow = 5015
    ActiveWindow.ScrollRow = 4954
    ActiveWindow.ScrollRow = 4862
    ActiveWindow.ScrollRow = 4780
    ActiveWindow.ScrollRow = 4698
    ActiveWindow.ScrollRow = 4607
    ActiveWindow.ScrollRow = 4504
    ActiveWindow.ScrollRow = 4361
    ActiveWindow.ScrollRow = 4300
    ActiveWindow.ScrollRow = 4167
    ActiveWindow.ScrollRow = 4065
    ActiveWindow.ScrollRow = 3963
    ActiveWindow.ScrollRow = 3861
    ActiveWindow.ScrollRow = 3789
    ActiveWindow.ScrollRow = 3698
    ActiveWindow.ScrollRow = 3616
    ActiveWindow.ScrollRow = 3555
    ActiveWindow.ScrollRow = 3473
    ActiveWindow.ScrollRow = 3371
    ActiveWindow.ScrollRow = 3279
    ActiveWindow.ScrollRow = 3218
    ActiveWindow.ScrollRow = 3136
    ActiveWindow.ScrollRow = 3034
    ActiveWindow.ScrollRow = 2952
    ActiveWindow.ScrollRow = 2870
    ActiveWindow.ScrollRow = 2809
    ActiveWindow.ScrollRow = 2717
    ActiveWindow.ScrollRow = 2615
    ActiveWindow.ScrollRow = 2533
    ActiveWindow.ScrollRow = 2452
    ActiveWindow.ScrollRow = 2380
    ActiveWindow.ScrollRow = 2298
    ActiveWindow.ScrollRow = 2196
    ActiveWindow.ScrollRow = 2125
    ActiveWindow.ScrollRow = 2064
    ActiveWindow.ScrollRow = 2002
    ActiveWindow.ScrollRow = 1921
    ActiveWindow.ScrollRow = 1829
    ActiveWindow.ScrollRow = 1726
    ActiveWindow.ScrollRow = 1645
    ActiveWindow.ScrollRow = 1563
    ActiveWindow.ScrollRow = 1502
    ActiveWindow.ScrollRow = 1430
    ActiveWindow.ScrollRow = 1369
    ActiveWindow.ScrollRow = 1328
    ActiveWindow.ScrollRow = 1267
    ActiveWindow.ScrollRow = 1236
    ActiveWindow.ScrollRow = 1185
    ActiveWindow.ScrollRow = 1144
    ActiveWindow.ScrollRow = 1093
    ActiveWindow.ScrollRow = 1063
    ActiveWindow.ScrollRow = 1022
    ActiveWindow.ScrollRow = 961
    ActiveWindow.ScrollRow = 940
    ActiveWindow.ScrollRow = 909
    ActiveWindow.ScrollRow = 807
    ActiveWindow.ScrollRow = 756
    ActiveWindow.ScrollRow = 726
    ActiveWindow.ScrollRow = 685
    ActiveWindow.ScrollRow = 634
    ActiveWindow.ScrollRow = 613
    ActiveWindow.ScrollRow = 572
    ActiveWindow.ScrollRow = 532
    ActiveWindow.ScrollRow = 521
    ActiveWindow.ScrollRow = 491
    ActiveWindow.ScrollRow = 470
    ActiveWindow.ScrollRow = 440
    ActiveWindow.ScrollRow = 429
    ActiveWindow.ScrollRow = 409
    ActiveWindow.ScrollRow = 378
    ActiveWindow.ScrollRow = 368
    ActiveWindow.ScrollRow = 358
    ActiveWindow.ScrollRow = 338
    ActiveWindow.ScrollRow = 327
    ActiveWindow.ScrollRow = 317
    ActiveWindow.ScrollRow = 297
    ActiveWindow.ScrollRow = 276
    ActiveWindow.ScrollRow = 266
    ActiveWindow.ScrollRow = 235
    ActiveWindow.ScrollRow = 215
    ActiveWindow.ScrollRow = 195
    ActiveWindow.ScrollRow = 184
    ActiveWindow.ScrollRow = 164
    ActiveWindow.ScrollRow = 154
    ActiveWindow.ScrollRow = 123
    ActiveWindow.ScrollRow = 103
    ActiveWindow.ScrollRow = 82
    ActiveWindow.ScrollRow = 62
    ActiveWindow.ScrollRow = 52
    ActiveWindow.ScrollRow = 41
    ActiveWindow.ScrollRow = 31
    ActiveWindow.ScrollRow = 11
    ActiveWindow.ScrollRow = 1
    Range("E3").Select
    ActiveCell.FormulaR1C1 = "=IF(COUNTIF(C[-4],RC[-3])=0,RC[-3],"""")"
    Range("E3").Select
    Selection.AutoFill Destination:=Range("E3:E5110")
    Range("E3:E5110").Select
    ActiveWindow.SmallScroll Down:=0
    Range("I1").Select
End Sub
 
Last edited by a moderator:

Excel Facts

Best way to learn Power Query?
Read M is for (Data) Monkey book by Ken Puls and Miguel Escobar. It is the complete guide to Power Query.
Please use code tags when posting code (especially really long code).

It doesn't look like you have anything on the clipboard to paste at that point.
 
Upvote 0

Forum statistics

Threads
1,223,879
Messages
6,175,148
Members
452,615
Latest member
bogeys2birdies

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
Back
Top