ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Clearing Cells (https://www.excelbanter.com/excel-programming/369009-clearing-cells.html)

Andyd74[_4_]

Clearing Cells
 

Hi,

I want to clear some cells within another sheet when a button is
pressed on a different sheet, the code i have so far is:

Sheets("February Stats").Select
ActiveSheet.Range("C8:R63").Select
Selection.ClearContents

But this obviously takes u into that sheet before deleting, so I then
have put a bit of code at the end that takes me back.

Is there a way to clear cells in another sheet, without having to
actually select it?

Thanks

Andy


--
Andyd74
------------------------------------------------------------------------
Andyd74's Profile: http://www.excelforum.com/member.php...o&userid=34013
View this thread: http://www.excelforum.com/showthread...hreadid=567113


Die_Another_Day

Clearing Cells
 
Sheets("February Stats").Range("C8:R63").ClearContents

HTH

Die_Another_Day
Andyd74 wrote:
Hi,

I want to clear some cells within another sheet when a button is
pressed on a different sheet, the code i have so far is:

Sheets("February Stats").Select
ActiveSheet.Range("C8:R63").Select
Selection.ClearContents

But this obviously takes u into that sheet before deleting, so I then
have put a bit of code at the end that takes me back.

Is there a way to clear cells in another sheet, without having to
actually select it?

Thanks

Andy


--
Andyd74
------------------------------------------------------------------------
Andyd74's Profile: http://www.excelforum.com/member.php...o&userid=34013
View this thread: http://www.excelforum.com/showthread...hreadid=567113




All times are GMT +1. The time now is 04:03 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com