Microsoft
Software
Hardware
Network
Question : Array Help
I have an array that gets populated from a datatable.
The problem I am facing, I need the array to have increments of 4.
If the datatable only has 2 records, I need to pad the array with 2 additional positions.
If the datatable only has 13 records, I need to pad the array with 3 additional etc. etc.
Any thoughts.
Code Snippet:
1:
arrToLabels(i) = "To:" + DtSet.Tables(0).Rows(i).Item(0) + "-" + DtSet.Tables(0).Rows(i).Item(1)
Open in New Window
Select All
Answer : Array Help
If DtSet.Tables(0).Rows / 4 = 0 Then
arrSize = DtSet.Tables(0).Rows
Else
arrSize = DtSet.Tables(0).Rows + (4 - (DtSet.Tables(0).Rows Mod 4))
End If
Random Solutions
Insert Range Contents into a UserForm
Include signature when creating new e-mail from VBA command
Terminal Services problem
How to open website (hosted on Win Server 2008, IIS) in Microsoft Frontpage 2000?
GetPivotdata Formula
To covert an access report with pictures to any editable document format retaining all the graphics and other formatting settings
SQL Select Distinct Results (Complex)
How do I setup a network with cross over cable between server 2008 and server 2003? 500pnts
Exchange 2007 - Transport Rule
How do I force a '0' value into a report