Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
BAC
 
Posts: n/a
Default Cell displays formula instead of result

Win 2000 Pro; Office 2003

I have a form where the user can enter either an "Equipment code" or an "ECI
Number". Since we do not know which one the user will have at the time he
completes the form, we have constructed a table that allows translation from
whichever one they enter to the one they don't have:

Col1: Col2: Col3:
Equip Code ECI Number Equip Code

I have a "Change event for the worksheet:

Private Sub Worksheet_Change(ByVal Target As Range)
'On Error GoTo xitsub
Application.EnableEvents = False

Select Case Target.Address
Case Is = "$E$49"
'Entered an Equipment Code
Cells(50, "E").Formula = "=VLOOKUP(E49,Y2:Z54,2,FALSE)"

Case Is = "$E$50"
'Entered an ECI Number
Range("E49").Formula = "=VLOOKUP(E50,Z2:AA54,2,FALSE)"

Case Else
End Select

xitsub:
Application.EnableEvents = True
End Sub

This works fine except that the cell that has the formula inserted displays
the Formula as text rather than evaluating the formula to its appropriate
result.

I have the cell formats set as text because both values have leading zeros I
need to display.

I have tried the Range().FormulaRC format but that did the same thing.

What am I missing here?

Thanx

BAC



  #2   Report Post  
Posted to microsoft.public.excel.misc
Pete
 
Posts: n/a
Default Cell displays formula instead of result

The cell does not have to be formatted as text to display leading zeros
- try this:

enter '01234 in cell A1. Make sure that B1 is formatted as general,
then enter =A1.

Perhaps you can make use of this.

Pete

  #3   Report Post  
Posted to microsoft.public.excel.misc
Gary''s Student
 
Posts: n/a
Default Cell displays formula instead of result

Just a try:

set the formats before putting the equation in
Range("E49").NumberFormat = "General", etc.
--
Gary's Student


"BAC" wrote:

Win 2000 Pro; Office 2003

I have a form where the user can enter either an "Equipment code" or an "ECI
Number". Since we do not know which one the user will have at the time he
completes the form, we have constructed a table that allows translation from
whichever one they enter to the one they don't have:

Col1: Col2: Col3:
Equip Code ECI Number Equip Code

I have a "Change event for the worksheet:

Private Sub Worksheet_Change(ByVal Target As Range)
'On Error GoTo xitsub
Application.EnableEvents = False

Select Case Target.Address
Case Is = "$E$49"
'Entered an Equipment Code
Cells(50, "E").Formula = "=VLOOKUP(E49,Y2:Z54,2,FALSE)"

Case Is = "$E$50"
'Entered an ECI Number
Range("E49").Formula = "=VLOOKUP(E50,Z2:AA54,2,FALSE)"

Case Else
End Select

xitsub:
Application.EnableEvents = True
End Sub

This works fine except that the cell that has the formula inserted displays
the Formula as text rather than evaluating the formula to its appropriate
result.

I have the cell formats set as text because both values have leading zeros I
need to display.

I have tried the Range().FormulaRC format but that did the same thing.

What am I missing here?

Thanx

BAC



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
Is it possible? DakotaNJ Excel Worksheet Functions 25 September 18th 06 09:30 PM
Can I make a formula in Excel to display result in same cell? Neiko Excel Worksheet Functions 2 October 1st 05 10:36 PM
Possible Lookup Table Karen Excel Worksheet Functions 5 June 8th 05 09:43 PM
reference the result of a formula in a text formatted cell jpwinston Excel Discussion (Misc queries) 1 February 7th 05 05:33 PM
Formula window displays correct answer while cell displays incorre MMV Excel Worksheet Functions 3 November 10th 04 09:28 PM


All times are GMT +1. The time now is 07:32 AM.

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"