+ Reply to Thread
Results 1 to 8 of 8

Auto Generated layer counting VBA

  1. #1
    Registered User
    Join Date
    08-27-2020
    Location
    Indonesia
    MS-Off Ver
    Microsoft Office profesional plus 2019
    Posts
    9

    Post Auto Generated layer counting VBA

    Hi all good people, could you please help me? I will break it down point by point, i hope I explain it well.
    1. My issue is in sheet4
    2. it is like an auto layer calculator
    3. column D is for me to fill each value (except D6)
    4. the value of total thickness is in D2, how many layers i want to split is in D3, for D4, and D5 is like the thickness of the top and bottom
    5. now I want if I have a specific layer for example the SC is all 1, then the LC will be remainingthickness - (how many SC layer* specific SC), then divide it to each LC.
    I have tried several times with the VB but I have not able to do it, Could anyone help me please?
    Thank you in advance.

    Extra note =
    1. My VBA has auto SC and LC generated and border
    2. sheet 1 and 2 is just my trial does the VBA works or not, and the difference from sheet 1 and 2 is just the top and bottom (D4 and D5 is included in the plies counting or not)
    Attached Files Attached Files

  2. #2
    Forum Expert bebo021999's Avatar
    Join Date
    07-22-2011
    Location
    Vietnam
    MS-Off Ver
    Excel 2016
    Posts
    9,481

    Re: Auto Generated layer counting VBA

    It better to put the MANUAL outcome in F:G.
    Test for some representative scenarios, for ex, change value of D3...
    Quang PT

  3. #3
    Registered User
    Join Date
    08-27-2020
    Location
    Indonesia
    MS-Off Ver
    Microsoft Office profesional plus 2019
    Posts
    9

    Re: Auto Generated layer counting VBA

    yes, but I need to keep revising if the plies number is change and other, that's why I try to use VBA

  4. #4
    Forum Expert bebo021999's Avatar
    Join Date
    07-22-2011
    Location
    Vietnam
    MS-Off Ver
    Excel 2016
    Posts
    9,481

    Re: Auto Generated layer counting VBA

    Quote Originally Posted by Elisa Ujianto View Post
    yes, but I need to keep revising if the plies number is change and other, that's why I try to use VBA
    You misunderstood me. What I mean is that please specify the desired results for each scenario, and we will assist you in writing the code to automate it

  5. #5
    Registered User
    Join Date
    08-27-2020
    Location
    Indonesia
    MS-Off Ver
    Microsoft Office profesional plus 2019
    Posts
    9

    Re: Auto Generated layer counting VBA

    Oh sorry for that, what I desire is for sheet4 sheets 1 and 2 are just trials), if I put a specific number in D7 (SC =), then all the outcomes in column G that is "SC ="(column F), will be filled with the value in D7, and for the "LC =" will be filled with the rest of the number, so the function is to give auto calculating thickness for each ply.

    To be more detailed about the purpose of this VB, I want to make a board made from some plies.
    for example, The board thickness should be 11,5 (D2), a total of plies/layers I want to use to make that board thickness 7 layers (D3), the top and the bottom thickness is 0,6 (D4) and 0,6 (D5), so the remaining thickness I need is D2-D4-D5 = 11,5-0,6-0,6 = 10,3, how many layers I need is 7 - 2 (top and bottom) = 5 that I will split into "SC =" and "LC =" it is alternate each other starting from "SC ="
    but I want a specific value for the SC in this example I put 1 (D7), then I need the VB to calculate the thickness of the LC per ply.
    in simple math is 10,3 - 1 (D7) * 3 (since I need 5 more ply, so SC, LC, SC, LC, SC) = 10,3 - 3 = 7,3
    I need 2 LC, so 7,3 / 2 = 3,65 to be written on each LC = in column G

    I am really sorry if my explanation is probably complicated

  6. #6
    Registered User
    Join Date
    08-27-2020
    Location
    Indonesia
    MS-Off Ver
    Microsoft Office profesional plus 2019
    Posts
    9

    Re: Auto Generated layer counting VBA

    Quote Originally Posted by bebo021999 View Post
    You misunderstood me. What I mean is that please specify the desired results for each scenario, and we will assist you in writing the code to automate it
    Oh sorry for that, what I desire is for sheet4 sheets 1 and 2 are just trials), if I put a specific number in D7 (SC =), then all the outcomes in column G that is "SC ="(column F), will be filled with the value in D7, and for the "LC =" will be filled with the rest of the number, so the function is to give auto calculating thickness for each ply.

    To be more detailed about the purpose of this VB, I want to make a board made from some plies.
    for example, The board thickness should be 11,5 (D2), a total of plies/layers I want to use to make that board thickness 7 layers (D3), the top and the bottom thickness is 0,6 (D4) and 0,6 (D5), so the remaining thickness I need is D2-D4-D5 = 11,5-0,6-0,6 = 10,3, how many layers I need is 7 - 2 (top and bottom) = 5 that I will split into "SC =" and "LC =" it is alternate each other starting from "SC ="
    but I want a specific value for the SC in this example I put 1 (D7), then I need the VB to calculate the thickness of the LC per ply.
    in simple math is 10,3 - 1 (D7) * 3 (since I need 5 more ply, so SC, LC, SC, LC, SC) = 10,3 - 3 = 7,3
    I need 2 LC, so 7,3 / 2 = 3,65 to be written on each LC = in column G

    I am really sorry if my explanation is probably complicated

  7. #7
    Forum Expert
    Join Date
    11-24-2013
    Location
    Paris, France
    MS-Off Ver
    Excel 2003 / 2010
    Posts
    9,831

    Question Re: Auto Generated layer counting VBA


    Hi,

    as it's « simple maths » so why do you not just use worksheet formulas like Excel is designed for ?!

  8. #8
    Registered User
    Join Date
    08-27-2020
    Location
    Indonesia
    MS-Off Ver
    Microsoft Office profesional plus 2019
    Posts
    9

    Re: Auto Generated layer counting VBA

    Quote Originally Posted by Marc L View Post

    Hi,

    as it's « simple maths » so why do you not just use worksheet formulas like Excel is designed for ?!
    Because I want to practice my VB and since I start learning VB, I love how VB could give auto border, auto highlight, clear content if some area is modified, so that's why I try to make this one.

    **edit
    but then I try and stuck on this problem

+ 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. Counting dates generated with the now function
    By Reddman in forum Hello..Introduce yourself
    Replies: 1
    Last Post: 05-03-2020, 03:12 PM
  2. Counting cells with conditional formatting generated strikethrough text
    By Pr0 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-17-2019, 11:57 AM
  3. Auto generated number
    By drobinson782001 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 11-18-2013, 10:00 PM
  4. Auto data entry on a different sheet layer
    By R.Sloan in forum Excel General
    Replies: 1
    Last Post: 08-14-2013, 11:19 AM
  5. [SOLVED] Counting unique entries only once & 3rd layer of dependent choices
    By ObiWanBaloney in forum Excel General
    Replies: 0
    Last Post: 06-04-2012, 06:16 PM
  6. Auto generated email with text
    By Regulator in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 03-24-2009, 08:46 PM
  7. Auto generated dates
    By Fifi in forum Excel General
    Replies: 1
    Last Post: 03-31-2006, 11:40 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