|
-
May 29th, 2019, 12:31 AM
#1
Thread Starter
Member
Re: How to add paragraph after datagridview data in excel using vb.net?
 Originally Posted by si_the_geek
You are using For loops to put the data in, and based on that code you can tell what the last row (and column) the data will be placed in.
The row that the For loops put data in to is i + 18 , and the highest value of i is DataGridView1.RowCount - 2
So, if you want to put something below it (with a one line gap), you could do this:
Code:
Dim lastRowForGrid as Integer = (DataGridView1.ColumnCount - 1) + 18
xlWorkSheet.Cells(lastRowForGrid + 2, 1) = "something here"
Thank you very much man it works! I forgot to mention on merging cells in this cell "xlWorkSheet.Cells(lastRowForGrid + 2, 1) = "something here"". How to merge cells from range of 1st column(A) to 11th columns(K)? Any idea?
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|