I have either a H or A in cell B5.

S

Skip

I have either a H or A in cell B5.
If B5 is A I need the values in B6,B7,B8
to be in R6,R7,R8.
If B5 is H I need the values in B6,B7,B8
to be in T6,T7,T8.
Any help with a formula much appreciated.
Thanks Skip
 
D

Dave Peterson

Formulas can't move values from one cell to another. They can only "put" stuff
into the cell that contains the formula.

So maybe you could use a formula like this in R6:
=if(b5="A",b6,"")

If b5 is equal to A, then show what's in B6. Otherwise, return an empty string
(make the cell look empty).

You'd have to use similar formulas for each cell (R6:R8 and T6:T8).
 
D

Don Guillett Excel MVP

Formulas can't move values from one cell to another.  They can only "put" stuff
into the cell that contains the formula.

So maybe you could use a formula like this in R6:
=if(b5="A",b6,"")

If b5 is equal to A, then show what's in B6.  Otherwise, return an empty string
(make the cell look empty).

You'd have to use similar formulas for each cell (R6:R8 and T6:T8).

Another approach. Right click the sheet tab>view code>insert this.
Test by an entry in b5

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Count > 1 Or _
Target.Address <> Range("b5").Address Then Exit Sub
Select Case UCase(Target)
Case "A": dc = "r"
Case "H": dc = "t"
Case Else: Exit Sub
End Select
Cells(6, dc).Resize(3).Value = Cells(6, "b").Resize(3).Value
End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top