当过滤的行为数字2时,下面的代码不起作用,这意味着它位于列标题下方,只检索列标题,但除此之外它工作正常。
for (int areaId = 1; areaId <= filteredRange.Areas.Count; areaId++)
{
Range rowRecord = filteredRange.Areas.Item(areaId);
object[,] areaValues = rowRecord.Value;
CustName = rowRecord.Cells[areaId, 1].Value2;
CustOrder= rowRecord.Cells[areaId, 39].Value2;
xcelValJobID = (string)areaValues[1, 1];
}