+ Reply to Thread
Results 1 to 10 of 10

output array in each row

  1. #1
    Registered User
    Join Date
    04-16-2013
    Location
    switzerland
    MS-Off Ver
    Excel 2003
    Posts
    8

    output array in each row

    I would like to output the array with the name of the country and to to have the country name in each row
    if I start from A4 to have germany in A4, France in A5, United Kingdom in A6

    The code I have bellow is working horizontally.

    MyArray = Array("Germany", "France", "United Kingdom")

    Range("A1:A3") = MyArray

  2. #2
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: output array in each row

    Please Login or Register  to view this content.

  3. #3
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: output array in each row

    Please Login or Register  to view this content.

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

    Re: output array in each row

    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    04-16-2013
    Location
    switzerland
    MS-Off Ver
    Excel 2003
    Posts
    8

    Re: output array in each row

    Many thanks, I'm very new into Excel and VBA

    It resolved 80% of my problem

    now my question is the following

    I try to copy the entire row on the A5 and duplicate a number of time (3 times depending of the number of item in the array) the I try to paste.

    My concern I would like each time I run the vba he will start to copy and past from A5, because if I run the vba the first time it will be fine but the second time the vba will past at A8 and not A5 , somehow I would like to override the existing row on A5

    My code:
    Please Login or Register  to view this content.
    Last edited by michelgirault; 06-19-2013 at 05:11 AM.

  6. #6
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: output array in each row

    Michel,
    Please use code tags with your code. You need to edit the last code and wrap it with code tags.

  7. #7
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: output array in each row

    vba will past at A8 and not A5.
    Yes, the NR has gone up to A8.
    When you re-run the code, NR will go back to 5, so what do you want to do?

  8. #8
    Registered User
    Join Date
    04-16-2013
    Location
    switzerland
    MS-Off Ver
    Excel 2003
    Posts
    8

    Re: output array in each row

    Sorry I was not clear.

    I want each time the VBA is run to paste at A5
    I guess there is a problem with
    Please Login or Register  to view this content.

  9. #9
    Forum Expert nilem's Avatar
    Join Date
    10-22-2011
    Location
    Ufa, Russia
    MS-Off Ver
    2013
    Posts
    3,377

    Re: output array in each row

    maybe so
    Please Login or Register  to view this content.

  10. #10
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: output array in each row

    Please Login or Register  to view this content.
    Resize(1) would not do anything as it is a default value

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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