+ Reply to Thread
Results 1 to 5 of 5

VBA or formula to autofill cells in accordance with cell contents in previous colums

  1. #1
    Registered User
    Join Date
    10-26-2012
    Location
    Bergen, Norway
    MS-Off Ver
    Excel 2010
    Posts
    15

    VBA or formula to autofill cells in accordance with cell contents in previous colums

    Hi. I have an excel sheet lot bigger than this but this example attached give you the clue. Which VBA Code or formula can be used to auto fill the blank cell in the colums. Where WIRE_COLOUR is blank is because of repeat of previous WIRE_COLOUR in accordance with NBR_GROUPS and NBR_WIRES. This means eg. in row 11 that if NBR_GROUPS=5 and NBR_WIRES=2 The Colour BK and BU should be filled in 4 more times each. For row 14 it would be: NBR_GROUPS=12 and NBR_WIRES=3 The Colour BK, BU and BN should be filled in 11 more times each.
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    11-29-2010
    Location
    Ukraine
    MS-Off Ver
    Excel 2019
    Posts
    4,168

    Re: VBA or formula to autofill cells in accordance with cell contents in previous colums

    hi sknifseht, please check attachment, option to make it
    Attached Files Attached Files

  3. #3
    Registered User
    Join Date
    10-26-2012
    Location
    Bergen, Norway
    MS-Off Ver
    Excel 2010
    Posts
    15

    Re: VBA or formula to autofill cells in accordance with cell contents in previous colums

    Hi watersev. EXELENT. Thanks alot:-) . Task SOLVED

  4. #4
    Registered User
    Join Date
    10-26-2012
    Location
    Bergen, Norway
    MS-Off Ver
    Excel 2010
    Posts
    15

    Re: VBA or formula to autofill cells in accordance with cell contents in previous colums

    Hi watersev. i little problem here. The macro you attached in thread work well in the example you attached in thread. But when i run it in my orginal file it will not work. My skills are obvious not god enough to adjust the code to the original file. I have tried all possible solution I can think of. I have changed reference to column B (NBR_GROUPS) and Column C (NBR_WIRES) to fit my orginal file but obvious my knowlege in VBA code comes to short. I have attached my orginal file to the orginal thread in hope you can give me some advice.

    Best Regards

  5. #5
    Forum Expert
    Join Date
    11-29-2010
    Location
    Ukraine
    MS-Off Ver
    Excel 2019
    Posts
    4,168

    Re: VBA or formula to autofill cells in accordance with cell contents in previous colums

    hi there, a small punctuation sign was missing but it have made a big difference. Sorry for that mistake on my side, the code is updated

+ 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