Microsoft Office Tutorials and References
In Depth Information
Example 19-13. The cmdCompleteColumns_Click Procedure
End If
End Sub
To get the SelectIfNotEmpty procedure, just change the line:
If IsEmpty(oCell) Then
to:
If Not IsEmpty(oCell) Then
Finally, the CompleteColumns and CompleteRows procedures are called from the
corresponding command-button Click events and are very similar. CompleteColumns is shown
in Example 19-13 .
Example 19-13. The cmdCompleteColumns_Click Procedure
Private Sub cmdCompleteColumns_Click()
' For each selected cell, select the entire column
Dim oCell As Object
Dim rngNew As Range
Set rngNew = Nothing
For Each oCell In Selection
If rngNew Is Nothing Then
Set rngNew = oCell.EntireColumn
Else
Set rngNew = Union(rngNew, oCell.EntireColumn)
End If
Next
rngNew.Select
cmdUndo.Enabled = True
End Sub
To get CompleteRows , just replace EntireColumn by EntireRow in two places.
 
Search JabSto ::




Custom Search