Call Equation According to choice

Closed
Diver - Mar 17, 2015 at 09:21 AM
MaxStart Posts 339 Registration date Tuesday March 3, 2015 Status Moderator Last seen July 3, 2015 - Mar 21, 2015 at 08:37 PM
Hello,
When choosing from a data validation list, i want some cells to import specified equations according to the choice selected from the list from other sheets,
How to transfer an equation from other sheets and make them activated to the same sheet & Take values from the same sheet which have the validation list not from the source sheet.
thanks in advance &
Waiting for reply



Related:

1 response

MaxStart Posts 339 Registration date Tuesday March 3, 2015 Status Moderator Last seen July 3, 2015 69
Mar 21, 2015 at 08:37 PM
in this example we have two sheets
sheet1 contains cell (A1) which contains a list (validation list)


*
      • first item
      • second item
      • third item

Cell (f2) on sheet 1 will change it's formula to match the formula of a cell on sheet 2 when cell A1 on sheet 1 changes it's value
the event used to check if cell A1 changed is:

Private Sub Worksheet_Change(ByVal Target As Range)

If Cells(1, 1).Value = "first item" Then
   Sheet1.Cells(2, 6).Formula = Sheet2.Cells(2, 6).Formula
   ElseIf Cells(1, 1).Value = "second item" Then
   Sheet1.Cells(2, 6).Formula = Sheet2.Cells(11, 6).Formula
   ElseIf Cells(1, 1).Value = "third item" Then
   Sheet1.Cells(2, 6).Formula = Sheet2.Cells(45, 6).Formula
Else
Cells(2, 6).Value = "non listed"
End If

End Sub

this should do the trick. good luck
--
Damn it !!!, is it ever gonna be the way I want it to be?
0