excel单元格扫描问题
附件中是一个excel文件,其中sheet2中代码是想扫描一下sheet2中所有的单元格内容,但总是处问题,请各位指教
Sub F()
Dim MaxRow As Long, MaxColumn As Long
Dim I As Long, J As Long
Dim SheetA As Sheets
MaxRow = Range("B65535").End(xlUp).Row
MaxColumn = Range("Z2").End(xlToLeft).Column
For I = 1 To MaxRow
For J = 1 To MaxColumn
If Not IsEmpty(Cells(I, J)) Then
MsgBox Cells(I, J)
End If
Next
Next
End Sub