why is copy and paste so tricky with vba?

ajm

Well-known Member
Joined
Feb 5, 2003
Messages
2,004
Office Version
  1. 365
Platform
  1. Windows
maybe its just me? anyhoo, i have a routine which opens another workbook, moves the data around and adds an autofilter. It should then copy the autofiltered range back to my source workbook.

Code:
With ESMwb.ActiveSheet.AutoFilter.Range
    .Offset(1, 0).Resize(.Rows.Count - 1).Copy
    Sourcewb.MainWS.Range("A" & LastRow + 1).PasteSpecial
    End With

I get "Run-time error 438: Object doesn't support this property or method" on the Sourcewb.MainWS... line

what is the correct syntax please?
 

Excel Facts

Spell Check in Excel
Press F7 to start spell check in Excel. Be careful, by default, Excel does not check Capitalized Werds (whoops)
@ajm....so it works now ???

sorry Michael. Yes it does. I have to do some reading (in all my spare time!....) on the when to use what with copy and paste. Its my achilles heel for some reason. thanks all for your help.
 
Upvote 0
yeah, I agree copy / paste special.....always used to do my head in....(y)
 
Upvote 0

Forum statistics

Threads
1,213,529
Messages
6,114,155
Members
448,554
Latest member
Gleisner2

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