I don't recommend the use of meregd cells for data sheets - most knowledgeable users avoid them as much as possible.
It is better, IMO, to just leave the cells unmerged. You already flag the payment as weekly or monthly. Why the need to merge cells?
However, give this code a try. It uses the worksheet change event to merge/unmerge cells in columns B:E when cells in column-A are changed to Monthly / Weekly.
This code must go into the worksheet module: right click sheet tab > View Code > copy & paste code into the VB Editor then close it.
If using Excel 2007 you must save to a .xlsm file type.
Option Explicit
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Cells.Count > 1 Then Exit Sub
If Not Intersect(Target, Range("A1:A100")) Is Nothing Then 'adjust range reference to suit
Select Case Target.Value
Case "Monthly"
Range("B" & Target.Row & ":E" & Target.Row).Merge
Case "Weekly"
Range("B" & Target.Row & ":E" & Target.Row).UnMerge
End Select
End If
End Sub
Bookmarks