- 進入Excel後,開啟Microsoft Visual Basic Editor ( 按 Alt + F11 )
- Insert (輸入) > Model (模組)
- 輸入程式如下,完畢後關閉Microsoft Visual Basic Editor
- 在工作表輸入並指定儲存格,是合併儲存格畫面
- 在工作表輸入並指定儲存格,不是合併儲存格畫面
Option Explicit
Public Function CheckMerged(Cx As Integer, Cy As Integer) As Boolean
CheckMerged = Cells(Cx, Cy).MergeCells
If CheckMerged Then
MsgBox "It is Merged"
Else
MsgBox "It isn't Merged"
End If
End Function