Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 22
Default selection_change adding text to target

Can I use selection_change to modify the current cell?

e.g I want to type 1234 into any cell in column A and have it change to
"Test - 1234 - Test" upon leaving the cell

TIA

Matt


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,441
Default selection_change adding text to target

Matt,

Copy the code below, right-click the sheet tab, select "View Code" and paste the code into the
window that appears.

I've use the change event because you talk about typing in and not just selecting as cell

HTH,
Bernie
MS Excel MVP

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Column < 1 Then Exit Sub
If Target.Cells.Count 1 Then Exit Sub
If Target.Value = "" Then Exit Sub
Application.EnableEvents = False
Target.Value = "Test - " & Target.Value & " - Test"
Application.EnableEvents = True
End Sub


"Matt Williamson" wrote in message
...
Can I use selection_change to modify the current cell?

e.g I want to type 1234 into any cell in column A and have it change to "Test - 1234 - Test" upon
leaving the cell

TIA

Matt



Reply
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
Excel fromula: Adding numbers from list to achieve a target BillD Excel Discussion (Misc queries) 4 May 28th 10 07:55 AM
Excel fromula: Adding numbers from list to achieve a target ck13 Excel Discussion (Misc queries) 0 May 27th 10 09:12 PM
Selection_Change? Sandy Excel Programming 2 August 4th 07 01:00 PM
Skip ... Selection_Change Event sgl Excel Programming 5 May 2nd 07 09:56 PM
retain hyperlink target when adding/deleting rows AGK New Users to Excel 3 May 23rd 06 01:59 AM


All times are GMT +1. The time now is 11:24 PM.

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

About Us

"It's about Microsoft Excel"