+ Reply to Thread
Results 1 to 11 of 11

VBA code to divide names exually to range

  1. #1
    Registered User
    Join Date
    11-05-2018
    Location
    Prague
    MS-Off Ver
    16.18
    Posts
    8

    Question VBA code to divide names exually to range

    Hello guys,

    is it possible to create macro which will be dividing names marked as "TRUE" behind him to range in column? The range will always be different, in this case it is 15

    I would like to have it like you can see below, but with my VBA basics I do not know how to do it
    Screen Shot 2019-02-16 at 10.47.39 PM.png

    Many thanks !

  2. #2
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,360

    Re: VBA code to divide names exually to range

    Try
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  3. #3
    Registered User
    Join Date
    11-05-2018
    Location
    Prague
    MS-Off Ver
    16.18
    Posts
    8

    Re: VBA code to divide names exually to range

    I did not specify it properly, sorry
    The main thing is: if there is "TRUE" behind name in E1, G1, I1 or K1 -- these marked names should be exually divided into column or range A1:A15 (15 cells, 3 names with TRUE - so every name will have 5 cells)

    But thank you !

  4. #4
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,360

    Re: VBA code to divide names exually to range

    Attach a sample workbook (not a picture or pasted copy). Make sure there is just enough data to demonstrate your need. Include a BEFORE sheet and an AFTER sheet in the workbook if needed to show the process you're trying to complete or automate. Make sure your desired results are shown, mock them up manually if necessary.

    Remember to desensitize the data.

    Click on GO ADVANCED and then scroll down to Manage Attachments to open the upload window.

  5. #5
    Registered User
    Join Date
    11-05-2018
    Location
    Prague
    MS-Off Ver
    16.18
    Posts
    8

    Arrow Re: VBA code to divide names exually to range

    Sorry, I added it.. hope it`s enough

    Thank you
    Attached Files Attached Files

  6. #6
    Forum Expert
    Join Date
    04-23-2009
    Location
    Matrouh, Egypt
    MS-Off Ver
    Excel 2013
    Posts
    6,882

    Re: VBA code to divide names exually to range

    Try this code
    Please Login or Register  to view this content.
    < ----- Please click the little star * next to add reputation if my post helps you
    Visit Forum : From Here

  7. #7
    Registered User
    Join Date
    11-05-2018
    Location
    Prague
    MS-Off Ver
    16.18
    Posts
    8

    Re: VBA code to divide names exually to range

    Works nice ! Thank you for your post, but it will always give 7 cells to each name... it should be calculated so
    if there will be for example 21 cells in table = each name should have 7 cells
    22 cells = each name 7 and last one 8 cells
    23 cells = first will have 7 and rest 8 cells (or vice versa)
    24 cells = each name will have 8
    see screenshot belowScreen Shot 2019-02-17 at 12.04.16 PM.png

    Thank you guys
    I appreciate it a lot

  8. #8
    Forum Expert
    Join Date
    04-23-2009
    Location
    Matrouh, Egypt
    MS-Off Ver
    Excel 2013
    Posts
    6,882

    Re: VBA code to divide names exually to range

    Try this version
    Please Login or Register  to view this content.

  9. #9
    Forum Expert
    Join Date
    07-20-2011
    Location
    Mysore, India.
    MS-Off Ver
    Excel 2019
    Posts
    8,577

    Re: VBA code to divide names exually to range

    Macro code
    Please Login or Register  to view this content.
    Pl note
    Array formula should be confirmed with Ctrl+Shift+Enter keys together.
    If answere is satisfactory press * to add reputation.

  10. #10
    Registered User
    Join Date
    11-05-2018
    Location
    Prague
    MS-Off Ver
    16.18
    Posts
    8

    Re: VBA code to divide names exually to range

    Working very well guys ! Thank you

    Reputation added at least

  11. #11
    Forum Expert
    Join Date
    04-23-2009
    Location
    Matrouh, Egypt
    MS-Off Ver
    Excel 2013
    Posts
    6,882

    Re: VBA code to divide names exually to range

    You're welcome. Glad we can offer some help

+ 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. [SOLVED] Count names, divide by 3, add division letter depending on which third
    By x65140 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 12-20-2018, 06:01 PM
  2. Using Range names in VBA code
    By Yoepy in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 01-27-2016, 11:17 PM
  3. Sheet names from range instead of altering the code
    By muralidaran in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 04-20-2015, 03:42 AM
  4. Loop through a range of names and apply each name to my code
    By papasmurfuo9 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-07-2015, 10:36 AM
  5. Match Names and divide values across sheets
    By antexity in forum Excel Formulas & Functions
    Replies: 10
    Last Post: 05-09-2014, 05:29 PM
  6. Excel 2007 VBA - Code for E-Mailing files to names in a range
    By jkr6064 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 10-26-2009, 09:28 AM
  7. [SOLVED] [SOLVED] VBA code to itemize range names and associations?
    By Larry A in forum Excel Programming / VBA / Macros
    Replies: 14
    Last Post: 07-02-2005, 08:05 AM

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