Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 102
Default Passing a String in Array to Range as String

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.

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,302
Default Passing a String in Array to Range as String

Hi Marston,

One way:

For i = LBound(Arr) To UBound(Arr)
With Range("A" & i + 1).Offset(1, 1)
.NumberFormat = "@"
.Value = Arr(i)
End With
Next i

---
Regards,
Norman



" wrote in message
...
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.



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Passing Query String into MS Excel napval Excel Discussion (Misc queries) 0 June 19th 07 06:04 AM
Passing string as array variable (Pivot VBA) klingongardener Excel Discussion (Misc queries) 2 December 23rd 06 07:58 PM
string passing to DLL Christoph Wirz Excel Programming 1 February 20th 04 02:40 PM
VBA - Convert my variable range array to single cell string Kevin G[_2_] Excel Programming 6 January 28th 04 07:20 AM
PASSING A STRING VALUE Sirron Excel Programming 2 August 26th 03 06:40 PM


All times are GMT +1. The time now is 08:31 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"