Creating Worksheets

Elemental

Board Regular
Joined
Jul 13, 2002
Messages
110
Hi again everybody,

when i copy a range of cells, what code is best used to clear the contents of another worksheet, so when their pasted into it, they dont leave old data from larger ranges pasted previously.

i get the Select Method Of Range Class Failed error,

i have tried

Sheets("Results").Select
Cells.Select
SendKeys ("^A")

==================

Sheets("Results").Select
Range("A1:Z1000").Value=""

and some other stuff, but it doesnt quite work out

perhaps deleting a worksheet, and creating a new one would clear it properly, and then i could just use the destination code to copy the data to.

things is, what kinda code is used ?
 

Excel Facts

Can you AutoAverage in Excel?
There is a drop-down next to the AutoSum symbol. Open the drop-down to choose AVERAGE, COUNT, MAX, or MIN
Hi, I would just replace the sendkeys statement with the following:-

cells.select
Selection.ClearContents
range("a1").select

This should clear it out. However, if you have comments they will still be left there.
Is it just pure data?

----
After seeing above post the selection.clear statement is better as it DOES clear comments as well. Cool.
This message was edited by parry on 2002-08-21 20:18
 
Upvote 0

Forum statistics

Threads
1,224,803
Messages
6,181,055
Members
453,014
Latest member
Chris258

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