Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3
Default 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   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3,101
Default 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   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 10,124
Default 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



  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 10,124
Default Move Cell Value to Right Using Formula

right click sheet tabview codeinsert thissee how it works and change to
suit.

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Column < 1 Then Exit Sub
Target.Offset(, Target.Value) = Target * Target

End Sub

--
Don Guillett
SalesAid Software

"Don Guillett" wrote in message
...

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   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 22,906
Default 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
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
formula, move to previous cell when the current cell=0 or empty osama amer Excel Discussion (Misc queries) 0 May 29th 06 12:18 PM
The absolute referenced cell does not move when source cell moves johnc Excel Worksheet Functions 2 May 8th 06 06:33 PM
How to keep a cell ref in formula unchanged when the ref cell move Clifton Ford Excel Discussion (Misc queries) 2 March 14th 06 04:55 PM
How do I move from a cell containing the formula TO a different c. PutFormula Excel Worksheet Functions 2 February 11th 05 06:59 PM
Arrow keys move screen instead of moving from cell to cell. JaJay777 Setting up and Configuration of Excel 1 January 17th 05 06:48 PM


All times are GMT +1. The time now is 04:54 PM.

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"