View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Bob Phillips Bob Phillips is offline
external usenet poster
 
Posts: 10,593
Default Need help with setting variables

Dim sNames

sNames = Array("James", "Ron", "Tony")

Range("M33").Select
If Range("AB22").Value = "N" Then
ActiveCell.Value = sNames(0)
Else: ActiveCell.Value = sNames(1)
End If



--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)

"erikkeith via OfficeKB.com" <u13156@uwe wrote in message
news:68a0394555271@uwe...
I want to set variables so I can use them in the following way:

A = James
B = Ron
C = Tony

Range("M33").Select
If Range("AB22").Value = "N" Then
ActiveCell = "A"
Else: ActiveCell = "Alternate"
End If

What syntax to I use to make this run in VBA?

--
Message posted via http://www.officekb.com