Forum Discussion
10 Replies
- cunderwCommunity Hero
Have you checked out the how-to guide yet?
- abrar22Frequent Contributor
Yes I have seen.
But in this code I cant see where i can pass which value i want to export to excel.
Thanks
A
- ghuff2Contributor
This is the section of code where they are writing a value to Excel:
' Write an index of the current row and column to a cell rowCount = sheet.UsedRange.Rows.Count + 1 For row = rowCount To rowCount + maxrow - 1 For col = 1 To maxcol sheet.Cells(row, col) = row & ", " & col Next Next
Specifically in the line fifth line where they call: sheet.Cells(row, col) = whatever value you want to be written to excel
Obviously you don't have to use for loops like they did. Just call sheet.Cells() with whatever row and column number you desire and set it equal to whatever value you want (course it has to be a value type that can be written in Excel)