Results 1 to 3 of 3

Thread: Copy selected data to other excel sheet

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Senior Member
    Join Date
    Apr 2011
    Posts
    190
    Rep Power
    15
    Below is an example - you just have to set the variables ahead of time - if you want to also change workbook just specify that ahead of the worksheet name(s)


    Code:
    SourceRangeVal = Split(Cells(1, ColumnFirst).Address, "$")(1) & FirstRecord & ":" & Split(Cells(1, ColumnLast).Address, "$")(1) & LastRecord
    DistinationRangeVal = Split(Cells(1, ColumnFirst).Address, "$")(1) & FirstRecord & ":" & Split(Cells(1, ColumnLast).Address, "$")(1) & LastRecord
    Worksheets("Sheet1").Range(SourceRangeVal).Copy Destination:=Worksheets("Sheet2").Range(DistinationRangeVal)
    If by selected values you mean cells highlighted (by the mosue) in your sheet then use the selection property - I am not sure exactly what you mean
    Last edited by Rasm; 02-02-2012 at 06:27 AM.
    xl2007 - Windows 7
    xl hates the 255 number

Similar Threads

  1. Replies: 1
    Last Post: 05-19-2013, 02:37 PM
  2. Replies: 3
    Last Post: 05-14-2013, 03:25 PM
  3. Replies: 1
    Last Post: 02-10-2013, 06:21 PM
  4. Replies: 2
    Last Post: 12-26-2012, 08:31 AM
  5. Replies: 2
    Last Post: 04-08-2012, 09:42 AM

Tags for this Thread

Posting Permissions

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