+ Reply to Thread
Results 1 to 14 of 14

Populating array data in column

  1. #1
    Forum Contributor
    Join Date
    05-13-2019
    Location
    Halifax, Canada
    MS-Off Ver
    2016
    Posts
    176

    Populating array data in column

    Hi all,

    I have stored 5 data in the array and I can populate them on row by the following code:

    Please Login or Register  to view this content.
    I am trying to learn to populate them in A1:A5. What changes do I have to make to get the result?

    I appreciate your advice.

    Thank you
    Roshan
    Last edited by Roshan.Shakya; 12-08-2019 at 08:15 PM. Reason: sub procedure name changed

  2. #2
    Forum Contributor
    Join Date
    05-13-2019
    Location
    Halifax, Canada
    MS-Off Ver
    2016
    Posts
    176

    Re: Populating array data in column

    Sorry there was a slight error (A1:A5). It should be A1:E1 (in the code). I am trying to learn how to populate array in column. I have edited now.

  3. #3
    Forum Guru
    Join Date
    04-23-2012
    Location
    New Jersey, USA
    MS-Off Ver
    Excel 365
    Posts
    2,401

    Re: Populating array data in column

    Change the name of your macro... you cannot use a VB function's name for the name of a procedure.
    Last edited by Rick Rothstein; 12-08-2019 at 08:03 PM.

  4. #4
    Forum Contributor
    Join Date
    05-13-2019
    Location
    Halifax, Canada
    MS-Off Ver
    2016
    Posts
    176

    Re: Populating array data in column

    Thank you Rick. I got you.

  5. #5
    Forum Contributor
    Join Date
    05-13-2019
    Location
    Halifax, Canada
    MS-Off Ver
    2016
    Posts
    176

    Re: Populating array data in column

    Rick it worked. Did you remove your code?

  6. #6
    Forum Guru
    Join Date
    04-23-2012
    Location
    New Jersey, USA
    MS-Off Ver
    Excel 365
    Posts
    2,401

    Re: Populating array data in column

    Quote Originally Posted by Roshan.Shakya View Post
    Did you remove your code?
    The code I posted and removed just showed that you could eliminate the variable and do everything in one line of code...
    Please Login or Register  to view this content.
    I removed it because it really had nothing to do with your original question.

  7. #7
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,465

    Re: Populating array data in column

    Quote Originally Posted by Roshan.Shakya View Post
    I am trying to learn to populate them in A1:A5. What changes do I have to make to get the result?
    2 ways
    Please Login or Register  to view this content.

  8. #8
    Forum Contributor
    Join Date
    05-13-2019
    Location
    Halifax, Canada
    MS-Off Ver
    2016
    Posts
    176

    Re: Populating array data in column

    That worked for me. I used that code. Anyway thanks. I was learning to populate in column.

  9. #9
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,465

    Re: Populating array data in column

    Quote Originally Posted by Roshan.Shakya View Post
    I was learning to populate in column.
    So, I have posted the codes.

  10. #10
    Forum Contributor
    Join Date
    05-13-2019
    Location
    Halifax, Canada
    MS-Off Ver
    2016
    Posts
    176

    Re: Populating array data in column

    Thanks jindon for the code,

    it worked with changes (Range("A1:A5") instead of [A1:A5].

    Roshan

  11. #11
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,465

    Re: Populating array data in column

    It's working as it is here, though...

    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED.

  12. #12
    Forum Guru
    Join Date
    04-23-2012
    Location
    New Jersey, USA
    MS-Off Ver
    Excel 365
    Posts
    2,401

    Re: Populating array data in column

    Quote Originally Posted by Roshan.Shakya View Post
    Thanks jindon for the code,

    it worked with changes (Range("A1:A5") instead of [A1:A5].
    You should not have had to change jindon's code... it is correct as written (he used a shortcut notation which your version of Excel should have no trouble recognizing). I am guessing from your last message that you noticed that jindon answered your originally posted message for filling in cells A1:A5 and not cells A1:E1 which you amended your request for in Message #2.

  13. #13
    Forum Contributor
    Join Date
    05-13-2019
    Location
    Halifax, Canada
    MS-Off Ver
    2016
    Posts
    176

    Re: Populating array data in column

    Thank you both of you. It is a very good learning. Actually i made mistake on my original post and i edited to rectify. Sorry for the confusion. And yes jindon’s code worked.

  14. #14
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,465

    Re: Populating array data in column

    Although I used the short cut notation of Evaluate method for a Range object, I would recommend Range, as there's no advantage of using it.
    And more, you can not use the benefit of intelisence.

+ 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: 09-12-2014, 03:05 AM
  2. Array populating only some data from Macro
    By edanielqsf in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-19-2014, 07:07 PM
  3. Replies: 2
    Last Post: 05-04-2013, 05:47 PM
  4. Populating array from Cell data
    By Aussiexile in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-12-2011, 05:57 PM
  5. Populating a column based on data from another column
    By fedro.pedro in forum Excel General
    Replies: 3
    Last Post: 08-25-2010, 12:51 PM
  6. Populating one column with row data
    By bton24 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 11-01-2006, 02:48 AM
  7. Populating an array from a integers values column rows
    By [email protected] in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 09-28-2005, 07:05 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