Results 1 to 4 of 4

Compile error in copy/paste code

Threaded View

carbonboywonder Compile error in copy/paste... 09-16-2010, 06:45 AM
StephenR Re: Compile error in... 09-16-2010, 06:53 AM
romperstomper Re: Compile error in... 09-16-2010, 07:08 AM
carbonboywonder Re: Compile error in... 09-16-2010, 07:46 AM
  1. #1
    Registered User
    Join Date
    04-24-2009
    Location
    London
    MS-Off Ver
    Excel 2003
    Posts
    43

    Compile error in copy/paste code

    Hi all,

    I am getting a "compile error: expected function or variable" when I run the following code. I guess I might be missing something pretty obvious, but I'm sure this code ran fine yesterday, so don't quite get it. If I only have one copy/paste function in the code it seems ok, but can't fathom why this doesn't work.

    The code is supposed to work by selecting an array (A1318:A2619 initially), copy and paste it to F12, where it is used to solve a formula residing in O12:O1312. These data are then selected, copied and pasted to S12. The whole procedure is then repeated by using the data in B1318:B2619 (hence the x values), and pasting to T12, etc...

    Sub IterationMacro()
    '
    ' IterationMacro Macro
    ' Macro recorded 11/8/2010 by gre
    '
    
    '
    Application.ScreenUpdating = False
    
        For x = 0 To 199 Step 1
       
        Range("A1318:A2619").Offset(0, x).Select
            Selection.Copy
                Range("F12").Select
                    Selection.PasteSpecial Paste:=xlValues, Operation:=xlNone, SkipBlanks:= _
        Range("O12:O1312").Select
            Selection.Copy
            Range("S12").Offset(0, x).Select
              Selection.PasteSpecial Paste:=xlValues, Operation:=xlNone, SkipBlanks:= _
                False, Transpose:=False
        Next x
            
    End Sub
    Last edited by carbonboywonder; 09-16-2010 at 07:48 AM. Reason: Solved

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