Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 74
Default Whan a letter is entered it changes to a symbol that is the value ofa different cell

Is there a way to enter a letter in a letter in a cell and once the
Enter key is struck, the letter will change to become a symbol that is
located in another cell? More specifically:

1) I have multiple ranges where I usually enter an "x". The ranges
are A1:C10 and A20:C30.

2) There is a symbol in Z1.

When I enter the "x" in multiples places within my ranges, I want the
"x" (or any other letter that might be entered) to instantly change to
the symbol when I stike the Enter key. Is this possible? Thanks for
any help you may offer.

Michael
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,722
Default Whan a letter is entered it changes to a symbol that is the value

Right click on sheet tab, view code, paste this in:

Private Sub Worksheet_Change(ByVal Target As Range)
If Intersect(Target, Range("A1:C10")) Is Nothing And _
Intersect(Target, Range("A20:C30")) Is Nothing Then Exit Sub
Application.EnableEvents = False
On Error Resume Next
Target.Value = Range("Z1").Value
Application.EnableEvents = True
End Sub
--
Best Regards,

Luke M
*Remember to click "yes" if this post helped you!*


"Michael Lanier" wrote:

Is there a way to enter a letter in a letter in a cell and once the
Enter key is struck, the letter will change to become a symbol that is
located in another cell? More specifically:

1) I have multiple ranges where I usually enter an "x". The ranges
are A1:C10 and A20:C30.

2) There is a symbol in Z1.

When I enter the "x" in multiples places within my ranges, I want the
"x" (or any other letter that might be entered) to instantly change to
the symbol when I stike the Enter key. Is this possible? Thanks for
any help you may offer.

Michael

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 74
Default Whan a letter is entered it changes to a symbol that is the value

Thanks Luke. Unfortunately the following debugs:

If Intersect(Target, Range("A1:C10")) Is Nothing And _
Intersect(Target, Range("A20:C30")) Is Nothing Then Exit Sub

No explanation is given and I'm purplexed.

Michael
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 22,906
Default Whan a letter is entered it changes to a symbol that is the value

I too am perplexed.

Works for me.

Try this version.

Private Sub Worksheet_Change(ByVal Target As Range)
Const WS_RANGE As String = "A1:C10, A20:C30"
If Not Intersect(Target, Me.Range(WS_RANGE)) Is Nothing Then
Application.EnableEvents = False
On Error Resume Next
Target.Value = Range("Z1").Value
End If
Application.EnableEvents = True
End Sub


Gord Dibben MS Excel MVP

On Fri, 18 Sep 2009 06:05:03 -0700 (PDT), Michael Lanier
wrote:

Thanks Luke. Unfortunately the following debugs:

If Intersect(Target, Range("A1:C10")) Is Nothing And _
Intersect(Target, Range("A20:C30")) Is Nothing Then Exit Sub

No explanation is given and I'm purplexed.

Michael


  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 74
Default Whan a letter is entered it changes to a symbol that is the value

I can find no logical reason why none of the above macros work, but
for some reason, everything I try debugs. I can only conclue that
some other macro is in conflict although there is nothing that really
gives any such indication.

Thank each of you for your efforts. They are much appreciated.

Michael


  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 74
Default Whan a letter is entered it changes to a symbol that is the value

FANTASTIC!

Bernie, your changes to my macro work. Thanks so very much. I do
have one last (I hope) question. When the macro executes, it
overrides my conditional formatting for each applicable cell. The
formatting is different throughout the range. Is there a way to avoid
changing the conditional formatting? Thanks.

Michael
  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,441
Default Whan a letter is entered it changes to a symbol that is the value of a different cell

Michael,

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

HTH,
Bernie
MS Excel MVP


Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Cells.Count 1 Then Exit Sub
If Intersect(Target, Range("A1:C10,A20:C30")) Is Nothing Then Exit Sub
If Target.Value < "" Then
Application.EnableEvents = False
Range("Z1").Copy Target
Application.EnableEvents = True
End If
End Sub


"Michael Lanier" wrote in message
...
Is there a way to enter a letter in a letter in a cell and once the
Enter key is struck, the letter will change to become a symbol that is
located in another cell? More specifically:

1) I have multiple ranges where I usually enter an "x". The ranges
are A1:C10 and A20:C30.

2) There is a symbol in Z1.

When I enter the "x" in multiples places within my ranges, I want the
"x" (or any other letter that might be entered) to instantly change to
the symbol when I stike the Enter key. Is this possible? Thanks for
any help you may offer.

Michael



  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 74
Default Whan a letter is entered it changes to a symbol that is the valueof a different cell

Bernie,

Thanks for the macro. However, the following debugs:

If Target.Cells.Count 1 Then

I'm uncertain as to how to proceed.

Michael
  #9   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,441
Default Whan a letter is entered it changes to a symbol that is the value of a different cell

Michael,

It sounds like you put the code into the wrong place. Right-click the sheet tab, select "View Code",
and paste the code into the window that appears.

The code needs to go into the worksheet codemodule, not a standard codemodule. The left-hand
dropdown above the code window should say "Worksheet" If it says "General" you pasted the code
into a standard codemodule.

HTH,
Bernie
MS Excel MVP


"Michael Lanier" wrote in message
...
Bernie,

Thanks for the macro. However, the following debugs:

If Target.Cells.Count 1 Then

I'm uncertain as to how to proceed.

Michael



  #10   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 74
Default Whan a letter is entered it changes to a symbol that is the valueof a different cell

Thanks for your help Bernie.

You were right. I misplaced my entry. (My status as a novice is
showing.) I tried to reconstruct a bit and enter the macro in
ThisWorkbook but again with no success. Perhaps you can quickly see
the problem. The range is a little different from my original sample
entry, as is the cell with the symbol. If you have a solution, it
would be much appreciated. Thanks again.

Private Sub Workbook_SheetChange(ByVal sh As Object, ByVal Target As
Range)
'MAKE 'X' CHANGE TO 'CHECK MARK' IN EXTBID & INTBID
If Target.Cells.Count 1 Then Exit Sub
If Intersect(Target, Worksheets("ExtBid").Range
("R2:T4,R7:T27,R42:T47")) Is Nothing Then Exit Sub
If Target.Value < "" Then
Application.EnableEvents = False
Worksheets("ExtBid").Range("AA4").Copy Target
Application.EnableEvents = True
End If
End Sub


  #11   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,441
Default Whan a letter is entered it changes to a symbol that is the value of a different cell

Michael,

For the Thisworkbook code, you need to check the Sheet name:

Private Sub Workbook_SheetChange(ByVal sh As Object, ByVal Target As Range)
'MAKE 'X' CHANGE TO 'CHECK MARK' IN EXTBID & INTBID
If Target.Cells.Count 1 Then Exit Sub
If sh.Name = "ExtBid" Or sh.Name = "IntBid" Then
If Intersect(Target, sh.Range("R2:T4,R7:T27,R42:T47")) Is Nothing Then Exit Sub
If Target.Value < "" Then
Application.EnableEvents = False
Worksheets("ExtBid").Range("AA4").Copy Target
Application.EnableEvents = True
End If
End If
End Sub

If IntBid has a different symbol, then use

sh.Range("AA4").Copy Target

in place of


Worksheets("ExtBid").Range("AA4").Copy Target

--
HTH,
Bernie
MS Excel MVP


"Michael Lanier" wrote in message
...
Thanks for your help Bernie.

You were right. I misplaced my entry. (My status as a novice is
showing.) I tried to reconstruct a bit and enter the macro in
ThisWorkbook but again with no success. Perhaps you can quickly see
the problem. The range is a little different from my original sample
entry, as is the cell with the symbol. If you have a solution, it
would be much appreciated. Thanks again.

Private Sub Workbook_SheetChange(ByVal sh As Object, ByVal Target As
Range)
'MAKE 'X' CHANGE TO 'CHECK MARK' IN EXTBID & INTBID
If Target.Cells.Count 1 Then Exit Sub
If Intersect(Target, Worksheets("ExtBid").Range
("R2:T4,R7:T27,R42:T47")) Is Nothing Then Exit Sub
If Target.Value < "" Then
Application.EnableEvents = False
Worksheets("ExtBid").Range("AA4").Copy Target
Application.EnableEvents = True
End If
End Sub



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
Automatically inserting a symbol when text is entered in the cell Frustratedfemale26 Excel Discussion (Misc queries) 1 August 28th 09 11:25 AM
Smart Tags: One Letter Stock Symbol Mark Excel Discussion (Misc queries) 0 January 20th 09 04:47 PM
Check Mark appears when a letter is entered in a field Gina Excel Programming 2 February 22nd 07 08:23 PM
A letter to generat a number when entered into anywhere on the spr Bill Fitzgerald Excel Worksheet Functions 2 April 26th 06 05:44 AM
how do I make drop-down list select based on 1st letter entered? Missykender Excel Discussion (Misc queries) 3 October 6th 05 11:55 PM


All times are GMT +1. The time now is 07:03 PM.

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"