How to get autoscroll in a multiline textbox?
Hi Nicola,
In XL2003 I have created this:
Option Explicit
Private Sub Worksheet_Change(ByVal target As Range)
txtLog.Text = txtLog.Text & vbNewLine & "Value of " & _
target.Address & " changed into " &
target.Value
GotoLastLine target
End Sub
Private Sub Worksheet_SelectionChange(ByVal target As Range)
txtLog.Text = txtLog.Text & vbNewLine & "Selection changed to " &
target.Address
GotoLastLine target
End Sub
Private Sub GotoLastLine(target As Range)
Application.EnableEvents = False
txtLog.Activate
txtLog.CurLine = (txtLog.LineCount - 1)
target.Select
Application.EnableEvents = True
End Sub
HTH,
Wouter
|