LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 31
Default Restricting sheet_selectionchange code to just one column

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
-----------------------------------------------------------
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Restricting Scroll Prevents Row and Column Choice Colin Hayes Excel Discussion (Misc queries) 3 June 11th 07 12:36 AM
Restricting copied text to one Column Viking Excel Programming 2 June 30th 06 02:28 PM
Restricting Rows Old Music Lover Excel Discussion (Misc queries) 1 July 23rd 05 02:27 AM
Restricting Macros Ed Excel Programming 4 January 17th 05 10:59 PM
Restricting Access to VB Code (xl98) MoonWeazel Excel Programming 3 March 5th 04 02:55 PM


All times are GMT +1. The time now is 08:58 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"