Hello,
Why not use a Select Case statement instead?
Sub SetMyValue()
Select Case Range("A9").Value
Case "123"
Range("D9").Value = "something"
Case "456"
Range("E5").Value = "something else"
Case Else
End Select
End Sub
Selecting cells will result in very slow code.
HTH,
JP
Try this, changing the hello excel part of course, this should get you started:
Sub main()
Range("D9").Select
ActiveCell.FormulaR1C1 = "Hello Excel"
Range("D9").Select
Selection.Font.Bold = True
End Sub
Discuss This Question: 1  Reply