+ Reply to Thread
Results 1 to 7 of 7

Macro to fill in missing blanks with data in a column

  1. #1
    Forum Contributor
    Join Date
    02-09-2004
    Location
    Cardiff - Wales - UK
    MS-Off Ver
    2013
    Posts
    475

    Question Macro to fill in missing blanks with data in a column

    Hi,

    I have a worksheet with data in column A and column B, the data in column A is a 'Code' e.g. 1234 and the data is colum B is a 'Businnes Unit' e.g. Head Office . My problem is that the corresponding rows underneath do not have the assciate 'Codes' and 'Business Units' so there are gaps until the next 'Code' and Business Unit.

    e.g row 1 - 1234 Headoffice



    row 9 - 2244 - South Office


    row 33 - 6755 - East Office

    Could any one please advise me of the macro code to automatically file in the blanks i.e. Codes and Businees Units

    Any assistance would be greatly appreciated


    Many thanks in advance



    Rob

    N.B Excdl version 2007
    Last edited by robertguy; 10-19-2012 at 02:50 AM. Reason: To mark as resolved
    Rob

  2. #2
    Forum Guru Winon's Avatar
    Join Date
    02-20-2007
    Location
    East Rand, R.S.A.
    MS-Off Ver
    2010
    Posts
    6,113

    Re: Macro to fill in missing blanks with data in a column

    Hi robertguy,

    Your post is a bit confusing.

    Do you actually mean to hide the empty rows, Filter or what Data would you like to be filled in where?
    Please consider:

    Be polite. Thank those who have helped you. Then Click on the star icon in the lower left part of the contributor's post and add Reputation. Cleaning up when you're done. If you are satisfied with the help you have received, then Please do Mark your thread [SOLVED] .

  3. #3
    Forum Contributor
    Join Date
    02-09-2004
    Location
    Cardiff - Wales - UK
    MS-Off Ver
    2013
    Posts
    475

    Question Re: Macro to fill in missing blanks with data in a column

    Winon,

    thanks for your reply and sorry for the confusion. What I want is for the missing data to be filled in automatically by the macro.

    N.B. the is no consistency with each master code as there could many or no 'Sub Codes', 'Amount', 'PM', ‘Finish Date’

    Please see example spreadsheet attached where there are two tabs 'Before Macro' and 'After Macro'

    Regards


    Rob
    Attached Files Attached Files

  4. #4
    Forum Expert mike7952's Avatar
    Join Date
    12-17-2011
    Location
    Florida
    MS-Off Ver
    Excel 2007, Excel 2016
    Posts
    3,520

    Re: Macro to fill in missing blanks with data in a column

    Give this a try

    Please Login or Register  to view this content.
    Thanks,
    Mike

    If you are satisfied with the solution(s) provided, please mark your thread as Solved.
    Select Thread Tools-> Mark thread as Solved.

  5. #5
    Forum Contributor
    Join Date
    02-09-2004
    Location
    Cardiff - Wales - UK
    MS-Off Ver
    2013
    Posts
    475

    Re: Macro to fill in missing blanks with data in a column

    Mike,

    thanks for the code it work as requested, however, if I want to use this code in other spread sheets what do I need to change to do the same for data in columns C and D etc

    Any help would be greatly appreciated

    Rob

  6. #6
    Forum Expert mike7952's Avatar
    Join Date
    12-17-2011
    Location
    Florida
    MS-Off Ver
    Excel 2007, Excel 2016
    Posts
    3,520

    Re: Macro to fill in missing blanks with data in a column

    Something like this

    Please Login or Register  to view this content.

  7. #7
    Forum Contributor
    Join Date
    02-09-2004
    Location
    Cardiff - Wales - UK
    MS-Off Ver
    2013
    Posts
    475

    Re: Macro to fill in missing blanks with data in a column

    Mike,

    thanks for the code it works as requested, sorry for the late feed back I thought I had already updated my post

    thanks again

    Rob

+ 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