Advertisement
Help Keep Boards Alive. Support us by going ad free today. See here: https://subscriptions.boards.ie/.
If we do not hit our goal we will be forced to close the site.

Current status: https://keepboardsalive.com/

Annual subs are best for most impact. If you are still undecided on going Ad Free - you can also donate using the Paypal Donate option. All contribution helps. Thank you.
https://www.boards.ie/group/1878-subscribers-forum

Private Group for paid up members of Boards.ie. Join the club.

Macro Help

  • 14-07-2008 10:43AM
    #1
    Posts: 6,176 ✭✭✭


    I've crossposted - sorry mods but I posted in the wrong forum first.

    Hiya,

    I have a dataset which has information on firms and shareholders.
    Each firm has a unique ID, however I need to tie this ID in to each shareholder.
    The data is of the form:

    Firm ID Number | Shareholder ID Number |
    00001
    X0001
    X0002
    X0003
    00002
    X0004
    X0005
    etc etc

    where - is a null.

    Is there a macro which will copy down each Firm ID into the nulls until it reaches the next firm ID, and then copies this down?

    Cheers,

    Z


Comments

  • Closed Accounts Posts: 114 ✭✭UsedtobePC


    Provided all your shareholders are grouped together by firm with the first of them containing the Firm ID you could do a loop like this:


    Row = First Row
    First Row.select
    Do While Row+1.value = null OR Row not EOF
    Firm ID = Row.value
    Paste Firm ID in Row+1
    Row = Row+1
    Loop


    Hope it helps


Advertisement