Thread: arrays
View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Toppers Toppers is offline
external usenet poster
 
Posts: 4,339
Default arrays

Something like?

Propnames = Array("Name", "Address1")
PropName = "Address1"
colnum = Application.Match(PropName, Propnames, 0)

HTH

"HSalim[MVP]" wrote:

Hi
I'd like to convert this case statement into an array

select Case PropName
Case "Name"
ColNum = 1
Case "Address1"
ColNum = 2
'more case statements
end select

instead
PropNames = Array("Name", "Address1"....)

colnum = <position of PropName in PropNames

I used to know this - i am blanking out.

Thanks for the help

Regards
Habib