+ Reply to Thread
Results 1 to 5 of 5

declare array and fill rows and columns

  1. #1
    Registered User
    Join Date
    08-18-2015
    Location
    Utrecht, Netherlands
    MS-Off Ver
    2010
    Posts
    69

    declare array and fill rows and columns

    Hi,

    I'm quite new into arrays. I'm lokking for a code that makes it possible to:

    - Delare an array (amount of columns is fixed, but amount of rows increase whille looping)
    - Write data to the array
    - Set Array back to worksheet

    Setting back the array to a worksheet is something i know how to do. I red something about that it isn't possible to add rows to an array, but it is possible to add columns. I can use the transpose for that i guess..

    Thanks in advance!

    Bart

  2. #2
    Forum Guru Kyle123's Avatar
    Join Date
    03-10-2010
    Location
    Leeds
    MS-Off Ver
    365 Win 11
    Posts
    7,238

    Re: declare array and fill rows and columns

    One normally needs to know how many rows you'll need in advance for the array. If you explain what you're actually trying to do we may be able to offer some suggestions:

    Attach a sample workbook. Make sure there is just enough data to demonstrate your need. Include a BEFORE sheet and an AFTER sheet in the workbook if needed to show the process you're trying to complete or automate. Make sure your desired results are shown, mock them up manually if necessary.

    Remember to desensitize the data.

    Click on GO ADVANCED and use the paperclip icon to open the upload window.

    View Pic

  3. #3
    Registered User
    Join Date
    08-18-2015
    Location
    Utrecht, Netherlands
    MS-Off Ver
    2010
    Posts
    69

    Re: declare array and fill rows and columns

    Hi,

    See workbook

    I want to loop through all the rows in sheet "KyleAll". So i fill an array with the data in this sheet, then i loop through the array. If column B = "hassolution" then i want to add this entire row to a new array.

    I don't know how many rows there are with "hassolution"..

    Regards
    Attached Files Attached Files

  4. #4
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: declare array and fill rows and columns

    Perhaps.
    Please Login or Register  to view this content.
    If posting code please use code tags, see here.

  5. #5
    Registered User
    Join Date
    08-18-2015
    Location
    Utrecht, Netherlands
    MS-Off Ver
    2010
    Posts
    69

    Re: declare array and fill rows and columns

    Norrie,

    Perfect! :-)

    Thanks!

    Bart

+ 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] VBA Declare Variables with array
    By bkeat in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 09-24-2014, 11:35 AM
  2. [SOLVED] Fill array from range selecting all rows and some columns
    By cgkmal in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-21-2014, 03:21 PM
  3. How do I declare and initialize an array?
    By Corey R. in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-23-2009, 05:04 PM
  4. How do I declare a function whose output is an array?
    By Schizoid Man in forum Excel General
    Replies: 1
    Last Post: 05-24-2006, 05:30 PM
  5. Global array declare
    By Souris in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 08-20-2005, 07:05 AM
  6. [SOLVED] How to declare a dynamic array
    By Peter Rooney in forum Excel General
    Replies: 4
    Last Post: 04-13-2005, 09: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