LineFill delete lock Revision 326561343166 (Sun Oct 28 2012 at 06:23) - Diff Link to this snippet: https://friendpaste.com/j4GDQaQsbkxeX8r2MoqWe Embed: manni perldoc borland colorful default murphy trac fruity autumn bw emacs pastie friendly Show line numbers Wrap lines 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859Sub Main() Dim x As Long Dim y As Long Dim l As String Dim a As Variant a = Selection.Value If 1 < UBound(a, 1) Then If 1 < UBound(a, 2) Then LineFill a, UBound(a, 1), UBound(a, 2), 1, 1 End If End If For y = LBound(a, 1) To UBound(a, 1) l = "" For x = LBound(a, 2) To UBound(a, 2) l = l & a(y, x) Next Debug.Print l NextEnd SubSub LineFill(a As Variant, my As Long, mx As Long, y As Long, x As Long) Dim i As Long Dim ny As Long Dim nx As Long For i = y + 1 To my If Not IsEmpty(a(i, x)) Then Exit For End If Next ny = i nx = x + 1 For i = ny - 1 To y + 1 Step -1 If Not IsEmpty(a(i, x + 1)) Then Exit For End If a(i, x) = " " Next a(i, x) = "└" For i = i - 1 To y + 1 Step -1 If IsEmpty(a(i, x + 1)) Then a(i, x) = "│" Else a(i, x) = "├" End If Next If nx < mx Then If y + 1 < ny - 1 Then LineFill a, ny - 1, mx, y + 1, nx End If End If If ny < my Then LineFill a, my, mx, ny, x End IfEnd Sub