Results 1 to 2 of 2
  1. #1
    New Lounger
    Join Date
    Aug 2002
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Copy & Paste a range

    Anyone out there use VBA for Applications? If so what command, when writing a macro, allows you to select a range of values including some formulas then paste into another range I choose. I have tried to figure it out to no avail. The only way I see it working is to paste into the same cell all the time?
    thanks,
    mark driver
    knoxville,tn

  2. #2
    Uranium Lounger
    Join Date
    Dec 2000
    Location
    Salt Lake City, Utah, USA
    Posts
    9,508
    Thanks
    0
    Thanked 6 Times in 6 Posts

    Re: Copy & Paste a range

    The Copy Method (edited) from the XL2k VBA Help File
    Syntax 2: Copies the Range to the specified range or to the Clipboard.

    Syntax 2
    expression.Copy(Destination)

    expression Required. An expression that returns an object in the Applies To list.
    Destination Optional Variant. Specifies the new range to which the specified range will be copied. If this argument is omitted, Microsoft Excel copies the range to the Clipboard.


    So you might copy and paste with a command such as:

    Worksheets("Sheet1").Range("MyNamedSourceRange").C opy Worksheets("Sheet2").Range("A1")

    this one line will copy the content of "MyNamedSourceRange" in Sheet1, whatever size it may be, to the corresponding range starting in cell A1 in worksheet Sheet 2.
    -John ... I float in liquid gardens
    UTC -7ąDS

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •