Hi, I want to create a module which store variable data into an array.
Ex:
gid is an integer data type
gid = 1932123
Now I want each digit to be stored in an array name idf using VBA
1
9
3
2
1
2
3
Thanks in advance
Hi, I want to create a module which store variable data into an array.
Ex:
gid is an integer data type
gid = 1932123
Now I want each digit to be stored in an array name idf using VBA
1
9
3
2
1
2
3
Thanks in advance
The quickest and easiest way :-
Amend the red to suit![]()
Dim FullDBArray Sub ArrayEx() Dim ShtName as string ShtName = "Data" FullDBArray = Sheets(ShtName).Range("A11:J" & Sheets(ShtName).Cells(Rows.Count, "A").End(xlUp).Row) End Sub
Last edited by AndyLitch; 02-15-2014 at 08:30 AM.
Elegant Simplicity............. Not Always
Hi mandukes,
maybe something like this
or![]()
Sub ertert() Dim dig&, x() As Byte, y(), i&, k& dig = 348565678 x() = CStr(dig): ReDim y(1 To UBound(x), 1 To 1) For i = 0 To UBound(x) Step 2 k = k + 1: y(k, 1) = Chr(x(i)) Next i Range("A1").Resize(k).Value = y() End Sub
![]()
Sub ertert2() Dim dig&, y(), i& dig = 348565666 ReDim y(1 To Len(CStr(dig)), 1 To 1) For i = 1 To Len(CStr(dig)) y(i, 1) = Mid(dig, i, 1) Next i Range("A1").Resize(i - 1).Value = y() End Sub
Last edited by nilem; 02-15-2014 at 08:59 AM.
WOW !! awesome!
Thank you nilem![]()
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks