Selection.Paste Please tell me whst is the error in this code and how it can be corrected.

vroom547

New Member
Joined
Jul 23, 2020
Messages
13
Office Version
  1. 2013
Platform
  1. Windows
Sub Macro1()

'

' Macro1 Macro

'

' Keyboard Shortcut: Ctrl+q



Range("F11:F36").Select

ActiveWindow.SmallScroll Down:=12

Range("F11:F36,F40:F48").Select

Range("F48").Activate

ActiveWindow.SmallScroll Down:=15

Range("F11:F36,F40:F48,F52:F53,F57:F61").Select

Range("F61").Activate

ActiveWindow.SmallScroll Down:=15

Range("F11:F36,F40:F48,F53:F57,F57:F61,F65:F66").Select

Range("F66").Activate

Selection.Copy

Windows("T-4 (2024 25) Qualification Spreadsheet").Activate

Sheets("Participants Data").Select

Range("A100000").End(xlUp).Select

ActiveCell.Offset(1, 0).Range("A2").Select

Selection.Paste Special Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _

:=False, Transpose:=True

End Sub
 

Excel Facts

Show numbers in thousands?
Use a custom number format of #,##0,K. Each comma after the final 0 will divide the displayed number by another thousand
It should be PasteSpecial, not Paste Special
 
Upvote 0
It should be PasteSpecial, not Paste Special
Thanks for your help buddy but that SPACE came while copy-pasting. I have added an image please check and it's showing a syntax error.
 

Attachments

  • error.JPG
    error.JPG
    84.3 KB · Views: 26
Upvote 0
Do you actually have a blank line between that & the :=False line?
 
Upvote 0
Simply remove the blank line
VBA Code:
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=True
or put it on one line
VBA Code:
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks:=False, Transpose:=True
 
Upvote 0
Simply remove the blank line
VBA Code:
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=True
or put it on one line
VBA Code:
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks:=False, Transpose:=True
I tried that already getting an application-defined error
 

Attachments

  • error.JPG
    error.JPG
    80.1 KB · Views: 17
Upvote 0
Step through the code using F8, what line does it fail on?
 
Upvote 0
Step through the code using F8, what line does it fail on?
Hi Fluff, I did that and found step where the error is there

Windows("T-4 (2024 25) Qualification Spreadsheet").Activate
 

Attachments

  • error.JPG
    error.JPG
    80.1 KB · Views: 17
Upvote 0
Is that workbook open?
If so try using
Rich (BB code):
 Workbooks("T-4 (2024 25) Qualification Spreadsheet.xlsx").Activate
change the file extension to suit.
 
Upvote 0

Forum statistics

Threads
1,223,911
Messages
6,175,327
Members
452,635
Latest member
laura12345

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