Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
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 |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
if equation | Excel Worksheet Functions | |||
Getting an Equation | Charts and Charting in Excel | |||
Equation Editor- problem when editing an equation | Excel Discussion (Misc queries) | |||
Need help with equation | Excel Discussion (Misc queries) | |||
Equation | Excel Discussion (Misc queries) |