Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Copy Paste problem

Status
Not open for further replies.

vestax22

Programmer
Jun 18, 2003
139
0
0
CA
Hey, I'm using Excel 2000 VBA

I do a copy from one sheet to another. At the end of macro execution I still have a blue highlighted area where the copy was performed. Is there a way to unselect the copy area after macro execuiton??

I tried
application.cutcopymode = false

and I want to avoid selecting a cell just to remove the copy selection.

Thx for the help
 
Do you have to use cut and paste? What if you just equated the values:
Code:
Worksheets("Sheet1").Cells(1,1).Value = Worksheets("Sheet2").Cells(10,10).Value
Then you don't need the - horribly slow -
Code:
.select
method.

********************
What's the best way to get the answers you need?? See FAQ222-2244 for details!
 
Hi vestax22,

There are two different things happening here. The blue highlighting is because you have Selected the copy source and the dashes around the area are because you have copied it. CutCopyMode = False removes the dashes, not the selection, but you don't need to Select the area just to copy it.

Instead of ..

Code:
Range("A1:B10").Select
Selection.Copy

.. just use

Code:
Range("A1:B10").Copy

Enjoy,
Tony
 
vestax22,

To learn more check out SkipVought's FAQ:

faq707-4105 - How Can I Make My Code Run Faster?

It will help you out with the "problem" that most novice VBA programmers have in programming with the Excel Object.

The best way to learn Excel VBA is to record a macro and then try to interpret what the macro recorder returns on code, but most of it is excess code. Skip's example shows you what difference it makes.

Enjoy! ;-)


Peace! [peace]

Mike

Never say Never!!!
Nothing is impossible!!!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top