+ Reply to Thread
Results 1 to 2 of 2

Basic syntax question regarding "COPY"

  1. #1
    Registered User
    Join Date
    04-28-2009
    Location
    Singapore
    MS-Off Ver
    Excel 2007
    Posts
    1

    Basic syntax question regarding "COPY"

    Hi I'm new to this forum and also a newbie with VBA.

    So very simply I have a question about VBA syntax regarding "Copy".

    The following line of codes actually works by managing to copy what is in my active sheet and pasting it in my worksheet in thisworkbook:

    Please Login or Register  to view this content.
    Why does the above line of codes works? But not the following two lines which gives me an error "object does not support the property or method" for my 2nd line? :
    Please Login or Register  to view this content.
    I've always thought a Destination Parameter is needed if you want to copy and paste in a single line. Otherwise you would need one line for copy and another line for paste.


    In case, you are wondering why I have an 'Activesheet' and a 'Thisworkbook'. I am actually trying to open a delimited file for pasting into my current workbook. The preceding line is to my above codes would be:

    'Workbooks.OpenText Filename:=strFN, DataType:=xlDelimited, Tab:=True


    Sorry if this is too rudimentary a question to ask. I'm just starting to pick up VBA.
    Last edited by kuants; 04-28-2009 at 05:36 AM. Reason: add code tags

  2. #2
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: One simple syntax question

    Have you read the Forum Rules yet/ The thread title could be better & you haven't used Code Tags.
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

+ 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