ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   VBA script to delete content in merged cells. (https://www.excelbanter.com/excel-programming/366516-vba-script-delete-content-merged-cells.html)

Calle

VBA script to delete content in merged cells.
 
Is there a VBA script to delete content in merged cells?

Dave Peterson

VBA script to delete content in merged cells.
 
See one way at your previous thread.

Calle wrote:

Is there a VBA script to delete content in merged cells?


--

Dave Peterson

Norman Jones

VBA script to delete content in merged cells.
 
Hi Calle,

See my response in your earlier thread.

However, more generally:

'=============
Public Sub Tester()
Dim rng As Range
Dim rCell As Range

Set rng = Range("A1:A10")

For Each rCell In rng.Cells
With rCell
If .MergeCells Then
.MergeArea.ClearContents
Else
.ClearContents
End If
End With
Next rCell

End Sub
'<<=============


---
Regards,
Norman



"Calle" wrote in message
...
Is there a VBA script to delete content in merged cells?





All times are GMT +1. The time now is 11:33 PM.

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