teylyn and roy; I can see merging cells isn't to smart to work with. However, it works really well for what I am doing. The only thing that stands in my way is the problem of merge / un-merge on a protected sheet. I wonder why this option is disabled. It just doesn't make any sense...
To explain further, the macro I'm using is creates theses blocks by merging cells. However I do not want the possibility to create a block where there are already some content.
Maybe it is possible to only allow this macro to create the boxes in a certain area?
heres the code for creating the merged boxes:
Option Explicit
Dim Col As Integer, Rw As Integer, Ac As Integer, Tx As String
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Target.Count = 1 Then
If Rw = 0 And Target.Column = 1 Then
Col = Target.Interior.ColorIndex
Rw = Target.Value
Ac = Target.Offset(, 1).Value
Tx = Target.Offset(, 2).Value
ElseIf Rw > 0 Then
If Target.Row >= Rw Then
Target = Tx
With Target.Offset(-Rw + 1).Resize(Rw, Ac)
.Interior.ColorIndex = Col
.BorderAround ColorIndex:=1, Weight:=xlThick
.HorizontalAlignment = xlCenter
.VerticalAlignment = xlCenter
.WrapText = True
.MergeCells = True
End With
Rw = 0
End If
End If
End If
End Sub
Bookmarks