Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
Move Cell Value to Right Using Formula
I'm trying to do the following:
If A1 = 2, then starting at position C5, move 2 cells to the right and populate with a value If A1 = 3, then starting at position C5, move 3 cells to the right and populate with a value etc... Appreciate any ideas Thanks, Sven |
#2
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
Move Cell Value to Right Using Formula
the cells to the right of C5 are E5 & F5 so put a formula in those cells
for E5 =IF(A1=2,"Some value","") for F5 =IF(A1=3,"Some value","") Mike " wrote: I'm trying to do the following: If A1 = 2, then starting at position C5, move 2 cells to the right and populate with a value If A1 = 3, then starting at position C5, move 3 cells to the right and populate with a value etc... Appreciate any ideas Thanks, Sven |
#3
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
Move Cell Value to Right Using Formula
Best done with a worksheet_change macro using an if or selectcase statement within -- Don Guillett SalesAid Software wrote in message oups.com... I'm trying to do the following: If A1 = 2, then starting at position C5, move 2 cells to the right and populate with a value If A1 = 3, then starting at position C5, move 3 cells to the right and populate with a value etc... Appreciate any ideas Thanks, Sven |
#5
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
Move Cell Value to Right Using Formula
Formulas cannot move things, only return results to the cell in which they
reside. Either have formulas in E5 and F5 like =IF(A1=2,"value for 2","not 2") Or go with event code. Private Sub Worksheet_Change(ByVal Target As Range) If Intersect(Target, Me.Range("A1")) Is Nothing Then Exit Sub On Error GoTo endit Application.EnableEvents = False Select Case Target.Value Case 2 Target.Offset(5, 4).Value = "value for 2" Case 3 Target.Offset(5, 5).Value = "value for 3" End Select endit: Application.EnableEvents = True End Sub This is sheet event code. Right-click on the sheet tab and "View Code". Copy/paste the above code into that sheet module. Gord Dibben MS Excel MVP On 4 Mar 2007 08:54:12 -0800, wrote: I'm trying to do the following: If A1 = 2, then starting at position C5, move 2 cells to the right and populate with a value If A1 = 3, then starting at position C5, move 3 cells to the right and populate with a value etc... Appreciate any ideas Thanks, Sven |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
formula, move to previous cell when the current cell=0 or empty | Excel Discussion (Misc queries) | |||
The absolute referenced cell does not move when source cell moves | Excel Worksheet Functions | |||
How to keep a cell ref in formula unchanged when the ref cell move | Excel Discussion (Misc queries) | |||
How do I move from a cell containing the formula TO a different c. | Excel Worksheet Functions | |||
Arrow keys move screen instead of moving from cell to cell. | Setting up and Configuration of Excel |