Log in

View Full Version : [SOLVED:] Clearing a merged range of 4 columns and 2 rows



Stevec63
10-12-2017, 12:56 AM
I have this problem above currently, but I am using VBA: Retail 7.1.1071 from Office 365.
I have tried adding below to my macro but it still doesn't work.
I am not that familiar with using "Name Manager" but I believe I have used it correctly see attached pic. 20631
Any ideas



Sub Clear_Cells()
Range("G17").ClearContents
Range("G22").ClearContents
Range("G27").ClearContents
Range("B3:B21").ClearContents
Range("B26:B49").ClearContents
Range("B53:B55").ClearContents
Range("b57:b64").ClearContents
Range("E3:E12").ClearContents
Range("E17:E27").ClearContents
Range("E34:E67").ClearContents
Range("G34:G50").ClearContents
Range("G57:G64").ClearContents
Range("I34:I50").ClearContents
Range("J34:J50").ClearContents
Range("TransactionTask").MergeArea.ClearContents
MsgBox "Form has been RESET"
End Sub

mdmackillop
10-12-2017, 02:52 AM
Range does not take a MergeArea. Simply

Range("TransactionTask").ClearContents

Stevec63
10-12-2017, 12:59 PM
Range does not take a MergeArea. Simply

Range("TransactionTask").ClearContents

I thought I had tried this already but obviously not as it worked ..... thank you. :-)