+ Reply to Thread
Results 1 to 7 of 7

Copy/Paste Array Data into Row Cells

  1. #1
    Registered User
    Join Date
    03-25-2010
    Location
    Ohio
    MS-Off Ver
    Excel 2007
    Posts
    25

    Copy/Paste Array Data into Row Cells

    I have a program created in 2003 and last made revisions in 2013. Unfortunately I have not been keeping up with my coding skills so need some help with taking data from an array and copying into cells in a row. Following is the code to create the array:

    Please Login or Register  to view this content.
    I want to copy the numbers in the holdindex to Columns C:J for each row an array is created unless there are less than 4 values.

    Thanks for any help you can provide...

  2. #2
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,643

    Re: Copy/Paste Array Data into Row Cells

    This puts the holdnumbers array in C:J in row j

    Please Login or Register  to view this content.
    Surround your VBA code with CODE tags e.g.;
    [CODE]your VBA code here[/CODE]
    The # button in the forum editor will apply CODE tags around your selected text.

  3. #3
    Registered User
    Join Date
    03-25-2010
    Location
    Ohio
    MS-Off Ver
    Excel 2007
    Posts
    25

    Re: Copy/Paste Array Data into Row Cells

    Thanks for your response! Unfortunately it results in a runtime 1004 error. Tried various scenarios with 'Compile error - expected array.' Following is where I inserted the line:

    Please Login or Register  to view this content.

  4. #4
    Forum Expert
    Join Date
    12-24-2007
    Location
    Alsace - France
    MS-Off Ver
    MS 365 Office Suite
    Posts
    5,066

    Re: Copy/Paste Array Data into Row Cells

    Perhaps,
    NOT TESTED
    Please Login or Register  to view this content.
    - Battle without fear gives no glory - Just try

  5. #5
    Registered User
    Join Date
    03-25-2010
    Location
    Ohio
    MS-Off Ver
    Excel 2007
    Posts
    25

    Re: Copy/Paste Array Data into Row Cells

    Folks, thanks for your help but I'm still not finding a solution that works like I need. I tried different iterations of both potential solutions and following is the one that came losest to providing the result needed:

    Please Login or Register  to view this content.
    Returns just the 1st number of the array in Col. "C" where all numbers up to 8 total are needed in Cols. "C":"J". I tried:

    Please Login or Register  to view this content.
    Returns the values in the last array in every cell from Row 3, Cols. "C : J" to the end of the worksheet.

    If you have any further ideas they would be appreciated.

  6. #6
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,643

    Re: Copy/Paste Array Data into Row Cells

    These two should both work

    Rows(j).Range("C1:J1").Value = holdnumbers

    Range("C" & j).Resize(, 8).Value = holdnumbers

  7. #7
    Registered User
    Join Date
    03-25-2010
    Location
    Ohio
    MS-Off Ver
    Excel 2007
    Posts
    25

    Re: Copy/Paste Array Data into Row Cells

    Thank You! The 2nd one did it!

+ 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. [SOLVED] Copy Filter Data and paste it on another workbook with special cells(Only Visible Cells)
    By HaroonSid in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 04-13-2014, 07:59 AM
  2. Testing for blank cells within Copy / Paste Array
    By MizM in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 07-30-2013, 11:39 PM
  3. [SOLVED] VBA to Copy set data, paste into set cells, then copy more & set into cells related 2 date
    By galvinpaddy in forum Excel Programming / VBA / Macros
    Replies: 99
    Last Post: 02-01-2013, 08:43 AM
  4. Replies: 1
    Last Post: 01-16-2013, 05:36 AM
  5. Formula to copy and paste data in cells to other cells based on values
    By haleakala17 in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 08-11-2012, 08:45 AM
  6. [SOLVED] Copy Data From Cells To Array
    By MarcL via OfficeKB.com in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 03-08-2006, 10:30 AM
  7. select variables ranges, copy to array, paste the array in new workbook
    By Mathew in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 04-01-2005, 05:06 AM

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