+ Reply to Thread
Results 1 to 8 of 8

Can you create a macro for this kind of formatting?

  1. #1
    Registered User
    Join Date
    06-20-2017
    Location
    North Carolina, United States
    MS-Off Ver
    version 15 (2013)
    Posts
    4

    Can you create a macro for this kind of formatting?

    Capture.PNG
    Capture2.PNG

    I have very little experience with macros and was wondering if there was any logical way to format a spreadsheet in the way explained below:

    I have attached two separate snapshots of a portion of a spreadsheet I was working on. As you can see in the first snapshot, this is a list of pesticide registrations. If you notice in column A, there are single entries for some registered products, and multiple entries for others (that is because some products contain multiple AIs, so each component of the product gets its "own" entry). I have to manually go in and box these entries, which can take up a lot of time if there are 200+ entries, like with this particular active ingredient there are 267 entries. Simply put, single entries are boxed alone, and multiple entries are boxed together in a single box. You can see this in the second attached snapshot image.
    I have a large list of active ingredients that I have to run registration lists for, such as this one, and each time I have to go through the same process of boxing "like" entries. I was wondering if there was any logical way to write a macro for this process, though since the data varies for each registration worksheet, I'm not sure how likely this is. I was just hoping there was some way to "map" this trend of boxing "like" items.
    Last edited by cmoore25; 06-20-2017 at 03:55 PM.

  2. #2
    Forum Expert Arkadi's Avatar
    Join Date
    02-13-2014
    Location
    Smiths Falls, Ontario, Canada
    MS-Off Ver
    Office 365
    Posts
    5,059

    Re: Can you create a macro for this kind of formatting?

    Looks to me as if the "like" entries all have the same value in column A? Is it just the borders you are trying to apply by code to "box" them?

    Can you upload a sample workbook? (when making a post, click "Go Advanced" scroll down, click "Manage Attachments", and upload your file).
    Last edited by Arkadi; 06-20-2017 at 02:53 PM.
    Please help by:

    Marking threads as closed once your issue is resolved. How? The Thread Tools at the top
    Any reputation (*) points appreciated. Not just by me, but by all those helping, so if you found someone's input useful, please take a second to click the * at the bottom left to let them know

    There are 10 kinds of people in this world... those who understand binary, and those who don't.

  3. #3
    Forum Expert Arkadi's Avatar
    Join Date
    02-13-2014
    Location
    Smiths Falls, Ontario, Canada
    MS-Off Ver
    Office 365
    Posts
    5,059

    Re: Can you create a macro for this kind of formatting?

    My guess without a file to test it on is something like this?

    Please Login or Register  to view this content.
    P.S. Welcome to the forum
    Last edited by Arkadi; 06-20-2017 at 03:08 PM.

  4. #4
    Registered User
    Join Date
    06-20-2017
    Location
    North Carolina, United States
    MS-Off Ver
    version 15 (2013)
    Posts
    4

    Re: Can you create a macro for this kind of formatting?

    Thank you for your response!
    Yes, I am only interested in creating a code that will box all of the entries with "like" registration numbers.
    Unfortunately this wasn't the best example as all of the entries shown in the small snippet are from the same company (there were over 100 entries for that company alone..I will probably just exclude those entries from the attached sample workbook...)
    Attached Files Attached Files

  5. #5
    Forum Expert Arkadi's Avatar
    Join Date
    02-13-2014
    Location
    Smiths Falls, Ontario, Canada
    MS-Off Ver
    Office 365
    Posts
    5,059

    Re: Can you create a macro for this kind of formatting?

    Updated for your sheet name, and added the Application.Screenupdating lines at start and end to make it smoother:

    Please Login or Register  to view this content.
    Last edited by Arkadi; 06-20-2017 at 03:15 PM. Reason: Added code to remove borders to start (in red)

  6. #6
    Registered User
    Join Date
    06-20-2017
    Location
    North Carolina, United States
    MS-Off Ver
    version 15 (2013)
    Posts
    4

    Re: Can you create a macro for this kind of formatting?

    That did the trick!!! You have no idea how happy you have just made me, as this process has been so repetitive/time-consuming for me to do manually.
    I cannot thank you enough, really!!! I wish you could've seen the stupid grin on my face when I ran the macro. This is like magic to me haha

  7. #7
    Forum Expert Arkadi's Avatar
    Join Date
    02-13-2014
    Location
    Smiths Falls, Ontario, Canada
    MS-Off Ver
    Office 365
    Posts
    5,059

    Re: Can you create a macro for this kind of formatting?

    Lol, well I'm glad it worked out for you! Please remember to mark the thread as solved if this resolves your request? Thanks
    Have a great day!

  8. #8
    Registered User
    Join Date
    06-20-2017
    Location
    North Carolina, United States
    MS-Off Ver
    version 15 (2013)
    Posts
    4

    Re: Can you create a macro for this kind of formatting?

    of course! Thank you!
    Have a great day as well!

+ 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. Create this kind of graph
    By shaibn in forum Excel General
    Replies: 2
    Last Post: 10-10-2016, 08:39 AM
  2. A special kind of macro
    By Zenden in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 07-31-2015, 07:10 PM
  3. How to create such kind of charts??
    By fantasista74 in forum Excel Charting & Pivots
    Replies: 1
    Last Post: 03-26-2015, 08:39 AM
  4. Conditonal Formatting if another cell has any kind of text.
    By P4r4gon in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 10-09-2014, 01:42 PM
  5. How to create this kind of charts?
    By Mrrobinson in forum Excel General
    Replies: 3
    Last Post: 01-21-2008, 06:34 AM
  6. [SOLVED] Is there a way to create a spesifig kind of program?
    By alhadschi in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 05-30-2006, 09:10 AM
  7. Replies: 2
    Last Post: 01-05-2005, 04:07 PM

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