intRangeLine = 4
'Iterate through the datasource
For Each r As DataRow In myDataTable.Rows
If intRangeLine > 4 Then
For c As Integer = 0 To 5
'Assign the value from the datasource to the range
If c = 0 Then
strDVID = r(c).ToString
arrDVID = Split(strDVID, "-")
Dim b As New Budget
strBudgetYear = "FY" & (arrDVID(0).ToString).Substring(2)
strPolicyCase = arrDVID(3).ToString
strBudgetCase = arrDVID(4).ToString
b = BudgetDB.GetSelectedBudgetName(strBudgetCase)
strBudgetCase = b.Description.ToString
intVersion = Convert.ToInt32(arrDVID(5))
Continue For
End If
Select Case c
Case 1
'aWorkSheet.Cells.Range(intRangeLine, c + 1).Value = strBudgetYear
aWorkSheet.Range(intRangeLine, c + 1).Value = strBudgetYear
End Select
'aRange.Cells(intRangeLine, c + 1) = r(c).ToString
Next
Else
intRangeLine += 1
End If
intRangeLine += 1
Next
SampleOutput.xlsx
Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.
When asked, what has been your best career decision?
Deciding to stick with EE.
Being involved with EE helped me to grow personally and professionally.
Connect with Certified Experts to gain insight and support on specific technology challenges including:
We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE