View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
erikkeith via OfficeKB.com erikkeith via OfficeKB.com is offline
external usenet poster
 
Posts: 31
Default Need help with setting variables

What if I wanted to add to sNames together in a range?

For instance if I Dim sNames and Dim sNames2 and then want to do this:

Range("sNames + sNames2").Select how would I write the syntax?

Bob Phillips wrote:
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

I want to set variables so I can use them in the following way:

[quoted text clipped - 9 lines]

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


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