Workbook_Activate


Private Sub Workbook_Activate()
Dim ad As Integer
Dim ak As Range
Dim al As Range
Set ak = Sheet1.Range("A1:A100")
Set al = Sheet1.Range("A1:Z1")
ad = WorksheetFunction.Count(ak)
ap = WorksheetFunction.Count(al)
MsgBox "Used rows" & "        :- " & ad & Chr(10) & "Used columns" & " :- " & ap
End Sub

Comments

Popular posts from this blog

50 Excel VBA Oral Interview Questions