Microsoft Office Tutorials and References
In Depth Information
Working with Ranges
Figure 11-2: This workbook uses a custom shortcut menu to demonstrate how to select variably sized
ranges by using VBA.
Often, you won’t want to actually select the cells. Rather, you’ll want to work with them in some
way (for example, format them). You can easily adapt the cell-selecting procedures. The
following procedure was adapted from SelectCurrentRegion . This procedure doesn’t select cells;
it applies formatting to the range that’s defined as the current region around the active cell. You
can also adapt the other procedures in the example workbook in this manner.
Sub FormatCurrentRegion()
ActiveCell.CurrentRegion.Font.Bold = True
End Sub
 
Search JabSto ::




Custom Search