+ Reply to Thread
Results 1 to 4 of 4

Error Occur when write .Range Code

  1. #1
    Registered User
    Join Date
    07-17-2012
    Location
    Malaysia
    MS-Off Ver
    Excel 2007
    Posts
    48

    Error Occur when write .Range Code

    Dear All,

    Could anyone point out my error why i can not write this coding ?

    " Worksheets("LB").Range("A2:X " & LastRow).Copy Destination:=.Range("A2") "

  2. #2
    Forum Expert Palmetto's Avatar
    Join Date
    04-04-2007
    Location
    South Eastern, USA
    MS-Off Ver
    XP, 2007, 2010
    Posts
    3,978

    Re: Error Occur when write .Range Code

    Please read the forum rules. Code tags are required when posting VBA code.
    You need to edit your thread and add the code tags.

    First, remove the quotes from around the code, then select the code and click the button with the # symbol.

    Just guessing since you didn't post all of your code.

    You have

    Please Login or Register  to view this content.
    Looks like you need

    Please Login or Register  to view this content.
    Notice that the >[ . ]< is removed

    Without seeing all of your code, it's hard to say. If you really meant to use [ . ], are you using the With/End With statement and have you fully qualified the sheet reference for the range object?
    Last edited by Palmetto; 12-07-2012 at 07:56 PM.
    Palmetto

    Do you know . . . ?

    You can leave feedback and add to the reputation of all who contributed a helpful response to your solution by clicking the star icon located at the left in one of their post in this thread.

  3. #3
    Registered User
    Join Date
    07-17-2012
    Location
    Malaysia
    MS-Off Ver
    Excel 2007
    Posts
    48

    Re: Error Occur when write .Range Code

    Here is the coding i work for it prompt out the message
    Please Login or Register  to view this content.
    Last edited by Leith Ross; 12-07-2012 at 09:51 PM. Reason: Added Code Tags

  4. #4
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: Error Occur when write .Range Code

    Hello gingank,

    The period character indicates that either an object, method or property follows after it. If nothing precedes the period then VBA looks for a "With" statement. Here is the code written with a "With" statement.

    Please Login or Register  to view this content.
    Sincerely,
    Leith Ross

    Remember To Do the Following....

    1. Use code tags. Place [CODE] before the first line of code and [/CODE] after the last line of code.
    2. Thank those who have helped you by clicking the Star below the post.
    3. Please mark your post [SOLVED] if it has been answered satisfactorily.


    Old Scottish Proverb...
    Luathaid gu deanamh maille! (Rushing causes delays!)

+ 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