Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 24
Default NEED EQUATION PLEASE

Would like equation that says if A1 to A10 has 400 in it, the change 400 to
"James"
Could someone please help me.
--
Carolan
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 11,058
Default NEED EQUATION PLEASE

You might need a macro for this:

Sub crln()
Set rr = Range("A1:A10")
For Each r In rr
If r.Value = 400 Then
r.Value = "James"
End If
Next
End Sub

--
Gary''s Student - gsnu200785


"Carolan" wrote:

Would like equation that says if A1 to A10 has 400 in it, the change 400 to
"James"
Could someone please help me.
--
Carolan

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 24
Default NEED EQUATION PLEASE

I'd rather do a formula if possible on a different sheet as I will have
several name. For example, 400 = James, 401 - John, 402 = Kevin. So there
could be all three numbers in a column.
--
Carolan


"Gary''s Student" wrote:

You might need a macro for this:

Sub crln()
Set rr = Range("A1:A10")
For Each r In rr
If r.Value = 400 Then
r.Value = "James"
End If
Next
End Sub

--
Gary''s Student - gsnu200785


"Carolan" wrote:

Would like equation that says if A1 to A10 has 400 in it, the change 400 to
"James"
Could someone please help me.
--
Carolan

  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Max Max is offline
external usenet poster
 
Posts: 9,221
Default NEED EQUATION PLEASE

Maybe something like this

Assume numbers in Sheet1, in A1 down
In Sheet2, place in A1:
=IF(Sheet1!A1="","",VLOOKUP(Sheet1!A1,{400,"James" ;401,"John";402,"Kevin"},2,0))
Copy down
--
Max
Singapore
http://savefile.com/projects/236895
xdemechanik
---
"Carolan" wrote:
I'd rather do a formula if possible on a different sheet as I will have
several name. For example, 400 = James, 401 - John, 402 = Kevin. So there
could be all three numbers in a column.

  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 24
Default NEED EQUATION PLEASE

Max, that works except what I'm trying to do is change the number in A1 to
the resulting text in the same cell. In otherwords, if A1=400, change the
400 in A1 to "James" So if I type 400 in A1 it will automatically change it
to "James" as soon as I move to the next cell.
--
Carolan


"Max" wrote:

Maybe something like this

Assume numbers in Sheet1, in A1 down
In Sheet2, place in A1:
=IF(Sheet1!A1="","",VLOOKUP(Sheet1!A1,{400,"James" ;401,"John";402,"Kevin"},2,0))
Copy down
--
Max
Singapore
http://savefile.com/projects/236895
xdemechanik
---
"Carolan" wrote:
I'd rather do a formula if possible on a different sheet as I will have
several name. For example, 400 = James, 401 - John, 402 = Kevin. So there
could be all three numbers in a column.



  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 8,651
Default NEED EQUATION PLEASE

As stated earlier, that needs a macro, not a formula.
--
David Biddulph

"Carolan" wrote in message
...
Max, that works except what I'm trying to do is change the number in A1 to
the resulting text in the same cell. In otherwords, if A1=400, change the
400 in A1 to "James" So if I type 400 in A1 it will automatically change
it
to "James" as soon as I move to the next cell.
--
Carolan


"Max" wrote:

Maybe something like this

Assume numbers in Sheet1, in A1 down
In Sheet2, place in A1:
=IF(Sheet1!A1="","",VLOOKUP(Sheet1!A1,{400,"James" ;401,"John";402,"Kevin"},2,0))
Copy down
--
Max
Singapore
http://savefile.com/projects/236895
xdemechanik
---
"Carolan" wrote:
I'd rather do a formula if possible on a different sheet as I will have
several name. For example, 400 = James, 401 - John, 402 = Kevin. So
there
could be all three numbers in a column.



  #7   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 5,651
Default NEED EQUATION PLEASE

On Mon, 12 May 2008 09:33:40 -0700, Carolan
wrote:

Max, that works except what I'm trying to do is change the number in A1 to
the resulting text in the same cell. In otherwords, if A1=400, change the
400 in A1 to "James" So if I type 400 in A1 it will automatically change it
to "James" as soon as I move to the next cell.


As has been written, you cannot do that with a formula. A formula can only
return a result to the cell in which it resides. It cannot change another
cell, nor can it change itself, yet persist within the cell.

Take another look at Gary's student macro.

Or, if you want this automatically, use an event macro.

To enter this, right click on the sheet tab and select View Code from the
dropdown menu. Then paste the code below into the window that opens.

=========================
Option Explicit
Private Sub Worksheet_Change(ByVal Target As Range)
Dim a As Range
Dim c As Range
'set up to change entries in Column A only
Set a = Range("A:A")
If Not Intersect(Target, a) Is Nothing Then
For Each c In Target
Select Case c
Case Is = 400
c.Value = "James"
Case Is = 401
c.Value = "John"
Case Is = 402
c.Value = "Kevin"
End Select
Next c
End If
End Sub
=================================
--ron
  #8   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Max Max is offline
external usenet poster
 
Posts: 9,221
Default NEED EQUATION PLEASE

If you want to keep it simple, you could always copy the formula col at the
end of the day, then overwrite the source col with a paste special as values
--
Max
Singapore
http://savefile.com/projects/236895
xdemechanik
---
"Carolan" wrote:
Max, that works except what I'm trying to do is change the number in A1 to
the resulting text in the same cell. In otherwords, if A1=400, change the
400 in A1 to "James" So if I type 400 in A1 it will automatically change it
to "James" as soon as I move to the next cell.
--
Carolan


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
if equation Robert Excel Worksheet Functions 3 February 3rd 06 09:26 AM
Getting an Equation kahlua_bundy Charts and Charting in Excel 3 November 11th 05 01:12 AM
Equation Editor- problem when editing an equation Gaby L. Excel Discussion (Misc queries) 0 September 27th 05 09:24 PM
Need help with equation mkerstei Excel Discussion (Misc queries) 1 August 4th 05 09:55 PM
Equation paulo_jorge_34 Excel Discussion (Misc queries) 3 June 14th 05 06:53 PM


All times are GMT +1. The time now is 03:51 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"