在这里寻求一点帮助。我试图让我的宏将仅包含其中信息的单元格的值粘贴到列表中。不幸的是,我的宏也拉出了所有空单元格,但将它们粘贴为空单元格。有谁知道如何让我的宏完全忽略空单元格?另外,我正在尝试将此宏粘贴到 C38,但我认为我的引用可能搞砸了..
Range("C11").Select
Application.CutCopyMode = False
ActiveCell.FormulaR1C1 = "3"
Range("C12").Select
SolverOk SetCell:="$A$20", MaxMinVal:=1, ValueOf:=0, ByChange:="$B$26:$V$29", _
Engine:=2, EngineDesc:="Simplex LP"
SolverOk SetCell:="$A$20", MaxMinVal:=1, ValueOf:=0, ByChange:="$B$26:$V$29", _
Engine:=2, EngineDesc:="Simplex LP"
SolverSolve UserFinish:=True
iMaxRow = 17
For iCol = 3 To 21
For iRow = 1 To iMaxRow
With Worksheets("Summary").Cells(iRow, iCol)
' Check that cell is not empty.
If .Value = "" Then
'Nothing in this cell.
'Do nothing.
Else
' Copy the cell to the destination
Worksheets("Summary").Cells(3, 38).Value = .Value
End If
End With
Next iRow
Next iCol
Sheets("Summary").Select