• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Auto populate a cell in another worksheet.

Shoebird

Member
Good afternoon all.

Here is my scenario and any help would be appreciated.

Lets say that in Worksheet 1, a condition is meet with a cell calculated value, is there any way have a text string in a cell in Worksheet 2 auto populated?

Ex.
Formula for cell B2. =IF(A2>4,Sheet2!A1="Success",IF(A2>3,Sheet2!A1="Marginal",IF(A2>2,Sheet2!A1="Fail",""))).

What I am trying to do is have a form in a separate worksheet auto complete with values without having the equations in reside in the destination sheet. I am thinking that VBA will be the solution. Thanks!
 

Somendra Misra

Excel Ninja
Hi,

Try using below code on Sheet1 Change event.

Code:
Private Sub Worksheet_Change(ByVal Target As Range)

If Not Intersect(Target, Range("A2")) Is Nothing Then ' Change Range A2 to your desired range where you want a changing data.
    Value1 = Target.Value
    Sheets("Sheet2").Range("A1") = Switch( _
        Value1 > 4, "Success", _
        Value1 > 3, "Marginal", _
        Value1 > 2, "Fails", _
        Value1 < 2, "")
End If

End Sub
Regards,
 

Shoebird

Member
Hi,

Try using below code on Sheet1 Change event.

Code:
Private Sub Worksheet_Change(ByVal Target As Range)
 
If Not Intersect(Target, Range("A2")) Is Nothing Then ' Change Range A2 to your desired range where you want a changing data.
    Value1 = Target.Value
    Sheets("Sheet2").Range("A1") = Switch( _
        Value1 > 4, "Success", _
        Value1 > 3, "Marginal", _
        Value1 > 2, "Fails", _
        Value1 < 2, "")
End If
 
End Sub
Regards,
Thanks Somendra!
 
Top