I have a problem with:
public void button20_Click(object sender, EventArgs e)
{
string CellDataID;
string[] IDString;
for (int RowCount = 2; RowCount <= LastRow; RowCount++)
{
xlRange = (Excel.Range)xlSht.Cells[RowCount, colNumberID];
CellDataID = (string)xlRange.Text;
PrinterBox1.Items.Add(CellDataID);
IDString = new string[LastRow];
IDString[RowCount - 1] = CellDataID;
}
}
I need to use all of IDString[]
items outside of the loop, but have no idea how to do it. VS C# is saying that the variable must have any value/declaration if i want to use it. Can anyone help me?
I had couple of nightmares about loops this week..