popup warning

  • Thread starter Thread starter Seeker
  • Start date Start date
S

Seeker

From time to time, excel prompts “Windows clipboard does not contain data in
a supported formatâ€. Does this related to my macro which has lots of copy/cut
and paste and I placed “Application.CutCopyMode = False†after each action of
paste action. How do I avoid the popup again please?
Rgds
 
While i don't have an answer for you related to your copy/paste issue (never
had it happen) copy/paste is kind of a bad way of doing things. You can put
things into an array and then output it where you want, this method gives you
total control to use the data as you wish, calculations etc. It is also easy,
I through some data into cells A1 to B6
Dim iVar As Variant
iVar = ActiveSheet.Range("A1:B6")

you can use any range, or use selected range or whatever. You won't have to
mess with all of the copy paste issues and it is MUCH faster.
 
There are some things that cause the clipboard to get cleared. If you've copied
something, then the macro stopped and you wanted another macro to paste, then
this may not work--most macros clear that clipboard.

But if it's in the same workbook, I try to keep my copy/cut's right near the
associated pastes.

Dim RngToCopy as range
dim DestCell as range

with worksheets("Somesheet")
set rngtocopy = ....
end with

with worksheets("someothersheet")
set destcell = ....
end with

'lots and lots of code here.

rngtocopy.copy _
destination:=destcell
 
Hi John and Peter,
As I am a tyro in the VBA, my project was done by the excel recorder and
kind donation of codes from experts in this forum. I understand set/dim,
as/=, variant/string etc should be used in programming to make it reliable
and efficiency, but I have no knowledge of these setting that’s why I use
copy/paste instead. Any wed page that you would suggest that I can learn
these setting please?
Rgds
 
Back
Top