S
shabutt
The below event code shows content of a cell which has just lost focus into a
textbox placed in a worksheet. This code works for all cells in the worksheet
but I want the code to restrict to a single column. Another question is
regarding the performance of code execution. How can I speed it up?
Your help is urgently need.
TIA
'A keen beginner in VBA'
-----------------------------------------------------------
Option Explicit
Dim rngLast As Range
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Application.ScreenUpdating = False
On Error Resume Next
If Not rngLast Is Nothing Then
Me.Shapes("TextBox").TextFrame.Characters.Text = rngLast(1, 6).Value
End If
Set rngLast = Target
Shapes("TextBox").SetShapesDefaultProperties
On Error GoTo 0
Application.ScreenUpdating = True
End Sub
-----------------------------------------------------------
textbox placed in a worksheet. This code works for all cells in the worksheet
but I want the code to restrict to a single column. Another question is
regarding the performance of code execution. How can I speed it up?
Your help is urgently need.
TIA
'A keen beginner in VBA'
-----------------------------------------------------------
Option Explicit
Dim rngLast As Range
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Application.ScreenUpdating = False
On Error Resume Next
If Not rngLast Is Nothing Then
Me.Shapes("TextBox").TextFrame.Characters.Text = rngLast(1, 6).Value
End If
Set rngLast = Target
Shapes("TextBox").SetShapesDefaultProperties
On Error GoTo 0
Application.ScreenUpdating = True
End Sub
-----------------------------------------------------------