View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Alan Beban[_2_] Alan Beban[_2_] is offline
external usenet poster
 
Posts: 783
Default Passing a String in Array to Range as String

wrote:

If I have an array that contains strings - some of which are numbers as
strings, why can't I write them to a range as a string?

For example if Array(1) = "000"

Why can't I say

Range("A1").Offset(1,1) = Array(1)

What I'm getting is 0 (without the leading 2 zeros) and when I do a
=IStext() test in the worksheet, I'm getting False.


The following seems to work:

Dim arr
arr = Array("000", "001", "002")
Range("A1").Offset(1, 1).NumberFormat = "@"
Range("A1").Offset(1, 1) = arr(1)

Alan Beban