bamaisgreat
Well-known Member
- Joined
- Jan 23, 2012
- Messages
- 831
- Office Version
- 365
- Platform
- Windows
Thanks all for looking. I have done some research and came up with the code below for clearing merged cells. The problem i have now is I need to add some more ranges of merged cells to the code and am unsure how. I need to add for the line with w5:x39 to carry on with more ranges.Example w5:x39,ya:ac39
Code:
Sub Clear()
'
' Clear Macro
'
Range("description").MergeArea.ClearContents
Range("job").MergeArea.ClearContents
Range("quotenum").MergeArea.ClearContents
Range("dwgnumber").MergeArea.ClearContents
Range("partnumber").MergeArea.ClearContents
Range("revisedby").MergeArea.ClearContents
Range("bomrevdt").MergeArea.ClearContents
Range("bombknumber").MergeArea.ClearContents
Range("datetoshop").MergeArea.ClearContents
Dim r As Range
Set r = Range("w5:x39")
If r.MergeCells Then
r.MergeArea.Select
r.MergeArea.UnMerge
r.ClearContents
r.Merge
Else
r.ClearContents
End If
End Sub