+ Reply to Thread
Results 1 to 2 of 2

script wont copy and paste

Hybrid View

  1. #1
    Valued Forum Contributor realniceguy5000's Avatar
    Join Date
    03-20-2008
    Location
    Fl
    MS-Off Ver
    Excel 2003 & 2010
    Posts
    951

    script wont copy and paste

    Hi Everyone,

    I have a script here that dosen't appear to be copying from sheet3 and pasting into sheet2.

    Can anyone see why this might not be working?

    Thanks for the help!!!

    Mike

    Private Sub ComboBox1_Change()
    
    Dim r As Integer
    Dim R2 As Integer
    
    Dim c1 As Integer
    Dim c2 As Integer
    
    r = 113 + ComboBox1.ListIndex
    R2 = 141 + ComboBox1.ListIndex
    
    If r <> 76 Then
    c1 = 3
    c2 = 5
    
    Set source_range = Range(Cells(r, c1), Cells(r, c2))
    Set source_range = Range(Cells(r, c1), Cells(r, c2))
    Sheets(3).Select
    
    source_range.Copy
    
    Sheets(2).Select
    
    Set destination_range = Range(Cells(8, c1), Cells(8, c2))
    destination_range.PasteSpecial xlValues
    
    'Set source_range = Range(Cells(R2, c1), Cells(R2, c2))
    'Set destination_range = Range(Cells(54, c1), Cells(54, c2))
    'source_range.Copy
    'destination_range.PasteSpecial xlValues
    
    End If
    Range("A30").Value = ComboBox1.Value
    
    With Range("A30")
    .Interior.ColorIndex = 3
    End With
    
    Range("a13").Select
    
    End Sub
    Last edited by realniceguy5000; 03-27-2009 at 03:13 PM.

  2. #2
    Forum Expert
    Join Date
    01-15-2007
    Location
    Brisbane, Australia
    MS-Off Ver
    2007
    Posts
    6,591

    Re: script wont copy and paste

    Hi

    1) Where is the combobox? Is it on a form, or a sheet
    2) If on a sheet, then which sheet?

    How about you set up an example file and attach so we can see what you are working on.


    rylo

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1