+ Reply to Thread
Results 1 to 3 of 3

Is VBA Always written backwards?

Hybrid View

  1. #1
    g48dd
    Guest

    Is VBA Always written backwards?

    This seems to me to be totaly backwards but I was using the macro recorder:

        Selection.Copy
        ActiveSheet.Next.Select
        Range("Q210").Select
        ActiveSheet.Paste
        ActiveSheet.Previous.Select
        Range("L201:L215").Select
        Application.CutCopyMode = False
    What I was doing was to copy a range from sheet three L201:L215 and then paste to sheet 4 Q210. But it puts the target first and then where I want to paste from, thats kind of backwards don'tcha know

  2. #2
    Forum Expert tigeravatar's Avatar
    Join Date
    03-25-2011
    Location
    Colorado, USA
    MS-Off Ver
    Excel 2003 - 2013
    Posts
    5,361

    Re: Is VBA Always written backwards?

    g48dd,

    The macro recorder always seems to do its own thing, but it is useful for getting started on learning VBA. The operation you recorded can be completed in just one line of code, though:

    [L201:L215].Copy Destination:=Sheets(ActiveSheet.Index + 1).[Q210]


    Hope that helps,
    ~tigeravatar

  3. #3
    Forum Expert Mordred's Avatar
    Join Date
    07-06-2010
    Location
    Winnipeg, Canada
    MS-Off Ver
    2007, 2010
    Posts
    2,787

    Re: Is VBA Always written backwards?

    Plus, I wonder if
    Selection.Copy
    represents the range L201:L215, in which case the recorder did not record backwards.
    If you're happy with someone's help, click that little star at the bottom left of their post to give them Reps.

    ---Keep on Coding in the Free World---

+ 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