Click here to Skip to main content
15,914,066 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: Split cells with comma and space Pin
Richard MacCutchan4-Feb-19 23:56
mveRichard MacCutchan4-Feb-19 23:56 
GeneralRe: Split cells with comma and space Pin
Richard Deeming5-Feb-19 1:17
mveRichard Deeming5-Feb-19 1:17 
AnswerRe: Split cells with comma and space Pin
Maciej Los5-Feb-19 1:41
mveMaciej Los5-Feb-19 1:41 
Questiondatagridview that was bound to dataset Pin
ClintSoft4-Feb-19 15:38
ClintSoft4-Feb-19 15:38 
QuestionLoad xlsx filr from folder and write to new workbook Pin
manju 33-Feb-19 20:25
manju 33-Feb-19 20:25 
QuestionRe: Load xlsx filr from folder and write to new workbook Pin
Richard MacCutchan3-Feb-19 22:23
mveRichard MacCutchan3-Feb-19 22:23 
AnswerRe: Load xlsx filr from folder and write to new workbook Pin
manju 34-Feb-19 21:39
manju 34-Feb-19 21:39 
GeneralRe: Load xlsx filr from folder and write to new workbook Pin
Richard MacCutchan4-Feb-19 22:00
mveRichard MacCutchan4-Feb-19 22:00 
You need to create a new Workbook, add some Worksheets and fill in their content, then save the new Workbook. Something like the following (Yes, I know it's C# but the principle is the same):
C#
//Create an Excel workbook instance and open it
Excel.Workbook excelWorkBook = excelApp.Workbooks.Add(Type.Missing);
Excel.Worksheet excelWorkSheet = excelWorkBook.Sheets.Add(Type.Missing);
excelWorkSheet.Name = "Sheet1";

int column = 1;
foreach (DataGridViewColumn dgc in dgvVolunteers.Columns)
{
    // row 1 contains column headers
    excelWorkSheet.Cells[1, column] = dgc.HeaderCell.Value;// copy headers from my DataGridView
    ++column;
}
column--;   // last Excel column is one less than the grid

int row = 2;    // data in Excel starts at A2
// copy from all the rows and columns in the DataGridView
// to the corresponding cells in the Worksheet
foreach (DataGridViewRow dgr in dgvVolunteers.Rows)
{
    for (column = 0; column < dgr.Cells.Count; ++column)
    {
        excelWorkSheet.Cells[row, column + 1] = dgr.Cells[column].Value;
    }
    row++;
}
// Save the new Workbook
excelWorkBook.SaveAs("MyFileName.xlsx");
excelWorkBook.Close();

GeneralRe: Load xlsx filr from folder and write to new workbook Pin
manju 34-Feb-19 23:49
manju 34-Feb-19 23:49 
QuestionMacro Substitution en VB.Net Pin
Member 141390043-Feb-19 17:00
Member 141390043-Feb-19 17:00 
AnswerRe: Macro Substitution en VB.Net Pin
Eddy Vluggen3-Feb-19 22:45
professionalEddy Vluggen3-Feb-19 22:45 
GeneralRe: Macro Substitution en VB.Net Pin
Member 141390049-Feb-19 13:24
Member 141390049-Feb-19 13:24 
GeneralRe: Macro Substitution en VB.Net Pin
Member 141390043-Mar-19 6:18
Member 141390043-Mar-19 6:18 
GeneralRe: Macro Substitution en VB.Net Pin
Eddy Vluggen3-Mar-19 6:28
professionalEddy Vluggen3-Mar-19 6:28 
AnswerRe: Macro Substitution en VB.Net Pin
Maciej Los5-Feb-19 2:38
mveMaciej Los5-Feb-19 2:38 
GeneralRe: Macro Substitution en VB.Net Pin
Member 141390049-Feb-19 13:25
Member 141390049-Feb-19 13:25 
GeneralRe: Macro Substitution en VB.Net Pin
Member 141390043-Mar-19 6:17
Member 141390043-Mar-19 6:17 
QuestionCompute Sum on a column based on criteria Pin
Member 1412885424-Jan-19 6:54
Member 1412885424-Jan-19 6:54 
AnswerRe: Compute Sum on a column based on criteria Pin
Richard Deeming24-Jan-19 8:41
mveRichard Deeming24-Jan-19 8:41 
GeneralRe: Compute Sum on a column based on criteria Pin
Member 1412885424-Jan-19 17:47
Member 1412885424-Jan-19 17:47 
QuestionRe: Compute Sum on a column based on criteria Pin
Ralf Meier24-Jan-19 19:58
mveRalf Meier24-Jan-19 19:58 
AnswerRe: Compute Sum on a column based on criteria Pin
Member 1412885424-Jan-19 21:07
Member 1412885424-Jan-19 21:07 
AnswerRe: Compute Sum on a column based on criteria Pin
Ralf Meier24-Jan-19 21:22
mveRalf Meier24-Jan-19 21:22 
QuestionUnable to load xlsm file with Office 2016 Pin
manju 323-Jan-19 20:18
manju 323-Jan-19 20:18 
QuestionRe: Unable to load xlsm file with Office 2016 Pin
Richard MacCutchan23-Jan-19 22:40
mveRichard MacCutchan23-Jan-19 22:40 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.