+ Reply to Thread
Results 1 to 4 of 4

Split clipboard area of a 2D area)to an array

  1. #1
    Forum Contributor
    Join Date
    02-18-2014
    Location
    hk
    MS-Off Ver
    Excel 365
    Posts
    105

    Split clipboard area of a 2D area)to an array

    Hi All,

    I write the below code to get a array from the clipboard which the clipboard is from a row of excel.

    Please Login or Register  to view this content.
    the below is my excel file
    A B C D E
    row 1 1 2 3 4 5
    row 2 6 7 8 9 10

    for example, If i copy A1 to A5 then I run the macro. I will get A1 to A5 to an array.
    myArray(0)=1;myArray(1)=2 ....
    but I can't do it with A1 to B5. Even I know excel use chr(13) to split the line.
    Also, if I copy A1 to A2. can I get the array be myArray(0)=1;myArray(1)=6 ?
    I know I can change the code chr(9) to char(13) to do this. but the same, I can't get an area that have more than one column.

    by the way, If possible, I want to put the A1 to B5 to myArray that
    myArray(1,1)=a myArray(1,2)=2... myArray(2,1)=6...myArray(2,5)=10
    Thanks for thinking the question.
    Last edited by mrkhchan; 04-08-2015 at 10:40 AM.

  2. #2
    Forum Guru karedog's Avatar
    Join Date
    10-03-2014
    Location
    Indonesia
    MS-Off Ver
    2003
    Posts
    2,971

    Re: Split clipboard area of a 2D area)to an array

    Hi,

    You can use the Clipboard2Array() function below :

    Please Login or Register  to view this content.
    Regards
    1. I care dog
    2. I am a loop maniac
    3. Forum rules link : Click here
    3.33. Don't forget to mark the thread as solved, this is important

  3. #3
    Forum Contributor
    Join Date
    02-18-2014
    Location
    hk
    MS-Off Ver
    Excel 365
    Posts
    105

    Re: Split clipboard area of a 2D area)to an array

    Thanks karedog. your code is perfect.

    Quote Originally Posted by karedog View Post
    Hi,

    You can use the Clipboard2Array() function below :

    Please Login or Register  to view this content.
    Regards

  4. #4
    Forum Guru karedog's Avatar
    Join Date
    10-03-2014
    Location
    Indonesia
    MS-Off Ver
    2003
    Posts
    2,971

    Re: Split clipboard area of a 2D area)to an array

    You are welcome mrkhchan, and many thanks for the reputation point.

    Regards

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Replies: 2
    Last Post: 03-25-2015, 07:13 AM
  2. Pivot Tables-Filtering in Page area (Report Filter Area)
    By Andrea Fuschetto in forum Excel Charting & Pivots
    Replies: 0
    Last Post: 02-03-2015, 03:37 PM
  3. [SOLVED] Formula for Replacing Codes Indicating Geographic Area with Actual Name of Area
    By andywozhere in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 09-10-2012, 08:53 AM
  4. Replies: 0
    Last Post: 02-28-2012, 09:47 AM
  5. Data on the clipboard is not the same size and shape as the selected area..
    By Darin Kramer in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-15-2005, 09:06 PM

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