+ Reply to Thread
Results 1 to 4 of 4

Left fuction in VBA code.

  1. #1
    Valued Forum Contributor
    Join Date
    11-20-2003
    MS-Off Ver
    2010, 2016
    Posts
    1,173

    Left fuction in VBA code.

    I am trying to use the Left function in my VBA code but continue to receive run time error 1004 - Method 'range' of object '_global' failed. Not sure if the error originates for code being written incorrectly or if the left function is not available in VBA. I am basically trying to take the first 9-characters for each cell in column K and copy the values to column G. Thank you.
    Please Login or Register  to view this content.
    Last edited by maacmaac; 12-26-2009 at 12:34 AM.

  2. #2
    Forum Expert
    Join Date
    01-03-2006
    Location
    Waikato, New Zealand
    MS-Off Ver
    2010 @ work & 2007 @ home
    Posts
    2,243

    Re: Using left fuction in VBA code.

    hi,

    Here are (edit: "two"! not "too" - duh me! end edit) untested code snippets that may help...
    Please Login or Register  to view this content.
    hth
    Rob
    Last edited by broro183; 12-26-2009 at 06:09 PM. Reason: spelling correction
    Rob Brockett
    Kiwi in the UK
    Always learning & the best way to learn is to experience...

  3. #3
    Valued Forum Contributor
    Join Date
    11-20-2003
    MS-Off Ver
    2010, 2016
    Posts
    1,173

    Re: Using left fuction in VBA code.

    Thanks. Both codes work. I ended up using the 2nd solution as it runs faster than the 1st.

  4. #4
    Forum Expert
    Join Date
    01-03-2006
    Location
    Waikato, New Zealand
    MS-Off Ver
    2010 @ work & 2007 @ home
    Posts
    2,243

    Re: Using left fuction in VBA code.

    Thanks for the feedback & marking the post as solved - I'm pleased I could help :-)

    Rob

+ 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