LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 690
Default populating cells with array bug?

Const s As String = "1234567890"
v = Replace(String(3276, "X"), "X", s)


Thanks Rick! Didn't think of that. Nice!
Dana DeLouis



On 10/14/09 1:22 PM, Rick Rothstein wrote:
For i = 1 To 3276
maxLengthValue = maxLengthValue & "0123456789"
Next i


HI. Just a different idea for building the string...

Sub Demo()
Dim v
Const s As String = "1234567890"
v = WorksheetFunction.Rept(s, 3276)
Debug.Print Len(v)
End Sub


You can get the same end result that your code produces using built-in
VB functions...

Sub Demo()
Dim v
Const s As String = "1234567890"
v = Replace(String(3276, "X"), "X", s)
Debug.Print Len(v)
End Sub



 
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
Populating a ListBox with an Array ironhydroxide Excel Programming 1 August 2nd 09 04:03 AM
Populating an array Bucs85027 Excel Worksheet Functions 0 February 14th 08 12:32 AM
populating a listbox from an array Graham Whitehead Excel Programming 2 August 2nd 06 01:11 PM
populating listview with array RB Smissaert Excel Programming 2 September 1st 04 05:41 PM
Populating a 2-D array Hotbird[_2_] Excel Programming 8 February 7th 04 05:25 PM


All times are GMT +1. The time now is 06:15 PM.

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

About Us

"It's about Microsoft Excel"