View Single Post
  #4   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

Activecell.Value = "James" & " " & "Reed"

--
HTH

Bob Phillips

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

"erikkeith via OfficeKB.com" <u13156@uwe wrote in message
news:68a2c501ef16d@uwe...
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