Microsoft Office Tutorials and References
In Depth Information
Working with Workbooks and Sheets
Set PasteRange = PasteRange.Range(“A1”)
‘ Copy and paste each area
For i = 1 To NumAreas
RowOffset = SelAreas(i).Row - TopRow
ColOffset = SelAreas(i).Column - LeftCol
SelAreas(i).Copy PasteRange.Offset(RowOffset, ColOffset)
Next i
End Sub
Figure 11-11 shows the prompt to select the destination location.
The companion CD-ROM contains a workbook with this example, plus another version
that warns the user if data will be overwritten. The file is named copy multiple
selection.xlsm .
Figure 11-11: Using Excel’s InputBox method to prompt for a cell location.
Working with Workbooks and Sheets
The examples in this section demonstrate various ways to use VBA to work with workbooks and
Search JabSto ::

Custom Search