Microsoft 365 and Office | Development | Other
Building custom solutions that extend, automate, and integrate Microsoft 365 apps.
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
When the user adds a row (B2),
I want to copy B1 row data to B2 row.
Although "SheetChange" is used, the information on B1 is not retrieved and only EMPTY are output.
How can i get B1 value?
void ThisWorkbook_SheetChange(object Sh, Excel.Range Target)
{
try
{
Excel.Worksheet ws_active = Globals.ThisAddIn.GetActiveSheet();
int column_index = Target.Column;
int row_index = Target.Row;
imsi_break = Convert_object_to_string(ws_active.Cells[row_index - 2, column_index].Value); //get only empty value
imsi_break = Convert_object_to_string(ws_active.Cells[row_index - 1, column_index].Value); //get only empty value
imsi_break = Convert_object_to_string(ws_active.Cells[row_index, 6].Value);
imsi_break = Convert_object_to_string(ws_active.Cells[row_index + 1, 6].Value); //get real value
imsi_break = Convert_object_to_string(ws_active.Cells[row_index + 2, 6].Value);
}
catch (Exception)
{
}
}