VBA Copy won't work

Roy_Excel_Island_Apps

Board Regular
Joined
Oct 9, 2018
Messages
69
Office Version
  1. 365
Platform
  1. Windows
Hi guys!

When performing a sht.Range("A1").copy or a Rows(4).copy or whatever... there are no marching ants to see... There is no problem when I do it manually.
Can't see what's the problem here...

Anyone of you who has a clue?

Regards, Roy
 

Excel Facts

Bring active cell back into view
Start at A1 and select to A9999 while writing a formula, you can't see A1 anymore. Press Ctrl+Backspace to bring active cell into view.
Do you have the prefix "sht." in front or your rows command as well ?
Check what sheet the value sht is pointing to in the code
or
Put a breakpoint on that line and in the immediate window type
? sht.name
I am expecting it to be different then the sheet your are looking at to see the marching ants
 
Upvote 0
Do you have the prefix "sht." in front or your rows command as well ?
Check what sheet the value sht is pointing to in the code
or
Put a breakpoint on that line and in the immediate window type
? sht.name
I am expecting it to be different then the sheet your are looking at to see the marching ants
Thanks for your answer Alex!
I just found out that the copy was doing OK, but couldn't see marching ants because screenupdate was FALSE.
The paste wasn't working because I was using PASTE instead op PASTESPECIAL. So pastespecial was the key for some reason.
 
Upvote 0
I actually tested with ScreenUpdating = False and the Marching ants were still visible.
To do a straight copy paste (which will includes formulas) you can put it all on one line.

VBA Code:
Range("A1").Copy Range("B1")
 
Upvote 0
I actually tested with ScreenUpdating = False and the Marching ants were still visible.
To do a full copy paste (which will include formulas) put it all on one line.

VBA Code:
Range("A1").Copy Range("B1")
Hmmm in that case I still wonder what made it work... Excel is being weird sometimes xD Thanks for your help!
 
Upvote 0

Forum statistics

Threads
1,214,867
Messages
6,122,002
Members
449,059
Latest member
mtsheetz

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