我使用
从单元格中获取值Number = ActiveWorkbook.Worksheets("CRMv1").Cells(2, 10).Value
当我有Number时,我想通过索引这个val来使用它来选择下一个单元格。
像
ActiveWorkbook.Worksheets("NEXT CONTATCT").Cells(**Number, 2**).Value
= ActiveWorkbook.Worksheets("CRMv1").Cells(13, 1).Value
任何人都可以帮我修复此代码吗?
答案 0 :(得分:0)
使用Range.Offset property或只是添加/减去数字。
'add 1 to Number to locate one row below
ActiveWorkbook.Worksheets("NEXT CONTATCT").Cells(Number + 1, 2) = _
ActiveWorkbook.Worksheets("CRMv1").Cells(13, 1).Value
'Offset 1 row below
ActiveWorkbook.Worksheets("NEXT CONTATCT").Cells(Number, 2).Offset(1, 0) = _
ActiveWorkbook.Worksheets("CRMv1").Cells(13, 1).Value