+ Reply to Thread
Results 1 to 9 of 9

Automate Numbering For A Circle With Perfect Boxes Inside It

  1. #1
    Registered User
    Join Date
    03-15-2017
    Location
    Malaysia
    MS-Off Ver
    Microsoft 2010
    Posts
    24

    Post Automate Numbering For A Circle With Perfect Boxes Inside It

    Hello everyone. I have a circle that shows boxes inside it. What I need is doing an automate numbering for the perfect boxes inside the circle. For example, the first perfect box falls on cell H6. So, the cell H6 is labelled as A1. This continue to other perfect boxes that is occupied inside the circle. I tried to use Record Macro but I have various size of the cells so I can't get any solution to this problem yet. Please help and thank you so much. These are my code:

    Please Login or Register  to view this content.
    Last edited by Ruffy; 03-16-2017 at 10:29 PM.

  2. #2
    Valued Forum Contributor Maudibe's Avatar
    Join Date
    12-21-2016
    Location
    USA
    MS-Off Ver
    2010-2013
    Posts
    326

    Re: Automate Numbering For A Circle With Perfect Boxes Inside It

    I may have your solution but you post will be snagged because you did not use code tags.

    Maud

  3. #3
    Registered User
    Join Date
    03-15-2017
    Location
    Malaysia
    MS-Off Ver
    Microsoft 2010
    Posts
    24

    Re: Automate Numbering For A Circle With Perfect Boxes Inside It

    I am so sorry. I just edited my post and now there are code tags. Please help.

  4. #4
    Valued Forum Contributor Maudibe's Avatar
    Join Date
    12-21-2016
    Location
    USA
    MS-Off Ver
    2010-2013
    Posts
    326

    Re: Automate Numbering For A Circle With Perfect Boxes Inside It

    Ruffy,

    I have been studying you code which does not quite match your description.

    The DrawCircleOnActiveCell routine draws a large formatted circle with its top at the same point of the top of cell B2 and the circle's left at the same point as the left of cell B2. This leaves cell B2 outside the left upper arc of the circle.

    Now I have manipulated you code two different ways:
    1. Draw the circle within cell B2
    2. Draw the circle so that it perfectly surrounds B2

    Are either of these you goal and if not, please explain the relationship between the circle and B2. Or are you just using B2 as a marker to position the circle on that part of the screen and there is no relationship.

    The WidthHeightInCentimeters routine is quite perplexing as what you are attempting to do. Here is what I see that your code does:
    1. Prompting for a cell width in micrometers
    2. converting micrometers to points
    3. 20 trial and errors to shrink cell widths to match the prompted width (now in points) which winds up in an endless loop

    To correct this, Dim your variables as double instead of integers
    Please Login or Register  to view this content.
    4. You had indicated there are various sized cells but your code selects all the cells then performs resizing on all of them ("Cells.Select") so they all end up the same size. Please comment

    You indicate you are attempting to label "perfect boxes" but you prompt for both a height (cm) and width (micrometers). Height and width should be the same therefore only one prompt seems reasonable. It is also unclear that when you achieve the box size you want how that relates to the circle. Are you attempting to label all the boxes that fall inside the circle?

    Your code can be simplified greatly. Can you please provide an image of what your sheet should look like after you run your code?

    Maud

    Can you post

  5. #5
    Registered User
    Join Date
    03-15-2017
    Location
    Malaysia
    MS-Off Ver
    Microsoft 2010
    Posts
    24

    Re: Automate Numbering For A Circle With Perfect Boxes Inside It

    Hello Maud. I am really sorry for the late reply. The parameter used is centimeters but then I divided the centimeters to convert it to become micrometers. I realized I typed wrongly for this part : cm = Application.InputBox("Enter Row Height in Centimeters"). Supposedly it is like this: cm = Application.InputBox("Enter Row Height in Micrometers"). I defined the circle by the given radius & the grid size depends on that radius. My actual goal is to automate the labeling of the dies on the wafer within the circle in perfect boxes. The sheet will look like in this link: http://www.silicon-edge.co.uk/j/inde.../die-per-wafer but now I need to do labeling as that is my actual goal. I am afraid as I think I need to do algorithm as the question is how to find the perfect boxes (They are the perfect boxes that are not cut off by the circle). I can only label them if I know which boxes are the perfect boxes and I only can do this by a mathematical calculation. So I need to write an algorithm for finding the perfect boxes.

  6. #6
    Valued Forum Contributor Maudibe's Avatar
    Join Date
    12-21-2016
    Location
    USA
    MS-Off Ver
    2010-2013
    Posts
    326

    Re: Automate Numbering For A Circle With Perfect Boxes Inside It

    Thanks for the reply. Very interesting project. Now that it is much clearer as to what you are trying to achieve I will make some changes to the code to see what we can do. I have a couple of ideas

    Maud

  7. #7
    Registered User
    Join Date
    03-15-2017
    Location
    Malaysia
    MS-Off Ver
    Microsoft 2010
    Posts
    24

    Re: Automate Numbering For A Circle With Perfect Boxes Inside It

    Thanks to you too!

  8. #8
    Registered User
    Join Date
    03-15-2017
    Location
    Malaysia
    MS-Off Ver
    Microsoft 2010
    Posts
    24

    Re: Automate Numbering For A Circle With Perfect Boxes Inside It

    I managed to do some improvements to the code. This time there is a shape that determines the center of the circle. The only requirement left is to labeling the perfect boxes within the circle as in the dies on the wafer. My new code is like this:
    Please Login or Register  to view this content.

  9. #9
    Registered User
    Join Date
    03-15-2017
    Location
    Malaysia
    MS-Off Ver
    Microsoft 2010
    Posts
    24

    Re: Automate Numbering For A Circle With Perfect Boxes Inside It

    To really automatically labeling all the perfect boxes only within the circle is quite hard. If we can't label all the perfect boxes within the circle automatically, can you help on how do I do this one? The user highlighted a range of cells (perfect boxes which are not cut off by the circle) within the circle and then Macro can numbering them automatically? Is there some way to do this?

+ 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] How to automate data validation inside a table?
    By gerotutu in forum Excel General
    Replies: 2
    Last Post: 01-29-2017, 09:53 PM
  2. Creating a circle/ellipse at a specific cell (as pictured inside)
    By vbaDunce in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 09-09-2014, 10:12 AM
  3. Color Plot - Perfect Circle
    By tangomj in forum Excel Charting & Pivots
    Replies: 1
    Last Post: 01-09-2014, 02:01 PM
  4. Replies: 4
    Last Post: 12-17-2012, 11:45 PM
  5. automate display project numbering
    By Revathi_guna in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 10-04-2009, 09:10 PM
  6. Is it possible to automate text boxes!??
    By vakej in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 08-25-2008, 05:44 PM
  7. perfect circle
    By martin622292 in forum Excel General
    Replies: 2
    Last Post: 12-01-2007, 06:32 PM

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