ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Selective clearence (https://www.excelbanter.com/excel-programming/438044-selective-clearence.html)

Gotroots

Selective clearence
 
Each cell in the range has data validation - Imput Message
How do I avoid this being deleted also.

Range("C5:D11,G5:G11").Select
Selection.Clear

Thank you if you can help.

Barb Reinhardt

Selective clearence
 
Try

ActiveSheet.Range("C5:D11,G5:G11").ClearContents
--
HTH,

Barb Reinhardt



"Gotroots" wrote:

Each cell in the range has data validation - Imput Message
How do I avoid this being deleted also.

Range("C5:D11,G5:G11").Select
Selection.Clear

Thank you if you can help.


joel[_488_]

Selective clearence
 

Use Clearcontents instead of Clear. Clear will remove formating while
clearcontents will only remove text/numbers.


--
joel
------------------------------------------------------------------------
joel's Profile: 229
View this thread: http://www.thecodecage.com/forumz/sh...d.php?t=167403

Microsoft Office Help


Gary''s Student

Selective clearence
 
Sub qwerrty()
Range("A1").ClearContents
End Sub

--
Gary''s Student - gsnu200909


"Gotroots" wrote:

Each cell in the range has data validation - Imput Message
How do I avoid this being deleted also.

Range("C5:D11,G5:G11").Select
Selection.Clear

Thank you if you can help.



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

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