【问题标题】:programmable naming variables? [closed]可编程命名变量? [关闭]
【发布时间】:2013-04-03 06:41:15
【问题描述】:

我有一个在 ASP.NET 中使用 Open XML SDK 2.0 的 Excel 自动化项目。我使用 Open XML SDK 2.0 Productivity Tool 为我的 excel 文件生成代码。 Сontains 行如

row9.Append(cell1043);
row9.Append(cell1044);
row9.Append(cell1045);
row9.Append(cell1046);
row9.Append(cell1047);
row9.Append(cell1048);

但我想要使用循环

For(i)
  For(j)
    row[i].Append(cell[j]);

有什么指导或建议吗?

【问题讨论】:

标签: c# asp.net vb.net excel openxml


【解决方案1】:

虽然你的问题不是很清楚,但应该这样做

    For r As Integer = 0 To 9
        For c As Integer = 0 To 9
            xlWSheet.Cells(r, c).value = "foo"
        Next
    Next

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-03-29
    • 2022-11-04
    • 2016-05-04
    • 2017-07-22
    • 1970-01-01
    相关资源
    最近更新 更多