+ Reply to Thread
Results 1 to 4 of 4

Populate Dynamic Array from Cell Values and write to Dynamic Range

  1. #1
    Forum Contributor
    Join Date
    03-30-2016
    Location
    Gillette, WY
    MS-Off Ver
    Office 365
    Posts
    230

    Populate Dynamic Array from Cell Values and write to Dynamic Range

    Hi all...again,

    Please see the attached workbook. I have a form in which the user will populate various cells with Chemical Application information. I need to get this data and populate a table to provide a running record of all chemicals applied, where, when and other data points. The approach I am trying now is a dynamic vba array whose elements are defined as:

    Rows = # of Chemicals Applied
    Columns = 29

    I have included the expected result of the Macro in the Chemical Application Records tab of the attached workbook. The Chemical data is highlighted in green and the rest of the data points are highlighted in red.

    I am using the following code:

    Please Login or Register  to view this content.
    When I run the macro, I get a 1 dimensional array of 28 columns when I should have a two dimensional array of 4 rows x 29 columns.

    Thank you all.

    TF
    Attached Files Attached Files

  2. #2
    Forum Contributor
    Join Date
    03-30-2016
    Location
    Gillette, WY
    MS-Off Ver
    Office 365
    Posts
    230

    Re: Populate Dynamic Array from Cell Values and write to Dynamic Range

    I've modified my code and solved one problem. I eliminated the internal i = 0 to i = 8 loop. The first row of the array is now returning the correct data, but it is still only producing an array of 1 row high by 29 columns wide. It should be 4 rows high by 29 columns wide. Any help is appreciated. My code and an updated workbook are attached.

    Please Login or Register  to view this content.
    Attached Files Attached Files

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

    Re: Populate Dynamic Array from Cell Values and write to Dynamic Range

    Change this...
    Please Login or Register  to view this content.
    To this...
    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.

  4. #4
    Forum Contributor
    Join Date
    03-30-2016
    Location
    Gillette, WY
    MS-Off Ver
    Office 365
    Posts
    230

    Re: Populate Dynamic Array from Cell Values and write to Dynamic Range

    ...thanks. rookie mistake.

+ 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] Dynamic Range/Dynamic Chart Using Cell Value for Reference and without CountA
    By kelseygueldalewis in forum Excel General
    Replies: 11
    Last Post: 09-11-2017, 04:52 PM
  2. Populate userform from dynamic range
    By HeyInKy in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 09-02-2014, 08:31 AM
  3. Pass Cell Values in a Dynamic Range to String
    By Jimmy0306 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-06-2013, 01:54 PM
  4. Loop new messages containing a table, populate a dynamic array, paste array to Excel
    By laripa in forum Outlook Programming / VBA / Macros
    Replies: 1
    Last Post: 05-19-2013, 07:20 AM
  5. [SOLVED] Populate Listbox with all rows of a dynamic array where elements of a single array match.
    By Tayque_J_Holmes in forum Excel Programming / VBA / Macros
    Replies: 21
    Last Post: 08-07-2012, 04:54 AM
  6. dynamic named range relating to cell values
    By mark_jam3s in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-01-2008, 06:57 AM
  7. Write a Listbox list to a dynamic range
    By blayne in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 11-29-2005, 01:40 PM

Tags for this Thread

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