+ Reply to Thread
Results 1 to 81 of 81

Creating a custom workbook

  1. #1
    Registered User
    Join Date
    06-01-2020
    Location
    Derbyshire
    MS-Off Ver
    Office 365
    Posts
    36

    Creating a custom workbook

    Hi Good morning people (UK)

    I'm Matt, from the United Kingdom, not a total excel "noob" I have managed to do some fairly basic workbooks up until now!.

    For my next project I want to enlist the help of the "hive mind" with a project I am working on.

    I want to create a workbook in excel that once opened displays a dialogue box asking how many sheets the user requires and also the option to amend this at a later time by reproducing that box from a check button somewhere on the first sheet. The sheets reproduced with all be to set standard which I will create.

    Is this at all possible in excel?

    Regards

    Matt

  2. #2
    Forum Expert Keebellah's Avatar
    Join Date
    01-12-2014
    Location
    The Netherlands
    MS-Off Ver
    Office 2021 (Windows)
    Posts
    7,905

    Re: Creating a custom workbook

    Hi welcome to the forum.
    What you are asking is possible but I would put the code to create this either in a AddIn that can be used 'Menu' or if only for your personal use in the Personal macrobook.
    All code for the part of creating and or removing sheets can be placed there. Even the standard (template) worksheet could be set in there.
    Need some more info but it's possible and many here will agree and probably have solutions somewhere on their harddisks and VBA libraries
    ---
    Hans
    "IT" Always crosses your path!
    May the (vba) code be with you... if it isn't; start debugging!
    If you like my answer, Click the * below to say thank-you

  3. #3
    Registered User
    Join Date
    06-01-2020
    Location
    Derbyshire
    MS-Off Ver
    Office 365
    Posts
    36

    Re: Creating a custom workbook

    Thx for replying promptly,

    I ideally want to keep everything in one file for ease of use, so if i share the document for other to use they don't have to install extra files. What other information are you after? please bare in mind i am a complete laymen to VB but i am willing to learn.

    Matt

  4. #4
    Valued Forum Contributor
    Join Date
    11-04-2018
    Location
    Denpasar
    MS-Off Ver
    Excel 2010
    Posts
    777

    Re: Creating a custom workbook

    Hi matt,
    Sorry if I'm not helping here.
    I just want to know more what is your situation.

    Quote Originally Posted by mattsporter View Post
    I want to create a workbook in excel
    Did you mean that a macro within an Excel Workbook to create a new workbook ?

    But from your next quote, then...

    that once opened displays a dialogue box asking how many sheets the user requires
    Then I think you want to create a sheet in a workbook, write a macro in this workbook,
    where the macro is to delete/add a sheet in this workbook ? For example :
    you write that macro in sample.xlsm where there are 10 sheets in this sample.xlsm
    What you want is :
    When this sample.xlsm is open, it ask how many sheets the user requires.
    If for example the user's answer is 7, then there will be 3 sheets is deleted (or hide ?)
    If for example the user's answer is 15, then there will be 5 new sheets is added.

    Sorry if I'm not getting your situation.

  5. #5
    Registered User
    Join Date
    06-01-2020
    Location
    Derbyshire
    MS-Off Ver
    Office 365
    Posts
    36

    Re: Creating a custom workbook

    Yes apologise if my question is vague.

    I want to create a workbook where everything is contained within one file. The work book would be used for LEV testing Local Exhaust Ventilation. at the moment we have only one word document pretty well laid out but everything is manual doing all the calculations and dimensions etc.

    Me being me, i'm quite lazy when i know there is better way to do something and make my work life easier i'll opt for that road.

    The work book would contain a front page explaining the system being tested, then a second page with a schamatic drawing and the then i want a button i can press to generate how ever many pages required which would be for individual capture points. The pages that it would generate are designed by me as well.

    hope this helps

    Regards

    Matt

  6. #6
    Registered User
    Join Date
    06-01-2020
    Location
    Derbyshire
    MS-Off Ver
    Office 365
    Posts
    36

    Re: Creating a custom workbook

    Quote Originally Posted by karmapala View Post
    Hi matt,
    Sorry if I'm not helping here.
    I just want to know more what is your situation.


    Did you mean that a macro within an Excel Workbook to create a new workbook ?

    But from your next quote, then...


    Then I think you want to create a sheet in a workbook, write a macro in this workbook,
    where the macro is to delete/add a sheet in this workbook ? For example :
    you write that macro in sample.xlsm where there are 10 sheets in this sample.xlsm
    What you want is :
    When this sample.xlsm is open, it ask how many sheets the user requires.
    If for example the user's answer is 7, then there will be 3 sheets is deleted (or hide ?)
    If for example the user's answer is 15, then there will be 5 new sheets is added.

    Sorry if I'm not getting your situation.
    What i did want was an input box to open as soon as the document opens asking for how ever many sheets needs to be made. But now looking into VB i think a Button on the top of the first page would be a better idea.

    I have managed to create a button and get it to function so when it is pressed a input box opens asking how many capture points are required. but this is as far as i have got for now.

    Regards

    Matt

  7. #7
    Valued Forum Contributor
    Join Date
    11-04-2018
    Location
    Denpasar
    MS-Off Ver
    Excel 2010
    Posts
    777

    Re: Creating a custom workbook

    Quote Originally Posted by mattsporter View Post
    I have managed to create a button and get it to function
    so when it is pressed a input box opens asking how many capture points
    are required. but this is as far as i have got for now.
    Something like this ?
    Please Login or Register  to view this content.
    The sub will create a new sheet as many as the user's answer in the inputbox.

  8. #8
    Registered User
    Join Date
    06-01-2020
    Location
    Derbyshire
    MS-Off Ver
    Office 365
    Posts
    36

    Re: Creating a custom workbook

    Thank you Karmapala

    This has worked to an extent, but when the sheets are created the always start before sheets 1. and when i delete them and recreate them it doesnt start form 2 again it will start from 13 or 14 or how ever many i created before.

    Regards

    Matt

  9. #9
    Forum Expert Keebellah's Avatar
    Join Date
    01-12-2014
    Location
    The Netherlands
    MS-Off Ver
    Office 2021 (Windows)
    Posts
    7,905

    Re: Creating a custom workbook

    Sheets in Excel are indexed so every time you add a new worksheet it takes the next index so if you delete worksheets it 'remembers' that the last one was for example 12 the next will be 13 even if there only two.
    Or you have to name them yourself even its index is 13 you can name it Sheet 2 but only if it doesn't already exist
    Then you also have to place them in the order you want, you can sort worksheets by their name
    As you see, your simple request has much more to it when you go deeper into it.
    You als mention
    I want to create a workbook where everything is contained within one file.
    What's in that file?

  10. #10
    Valued Forum Contributor
    Join Date
    11-04-2018
    Location
    Denpasar
    MS-Off Ver
    Excel 2010
    Posts
    777

    Re: Creating a custom workbook

    but when the sheets are created the always start before sheets 1
    The code below will create a new sheet always after Sheet1.

    and when i delete them and recreate them it doesnt start form 2 again it will start from 13 or 14 or how ever many i created before
    Yes, because Excel create the sheet with a name automatically.

    Please Login or Register  to view this content.
    The code above will name the newly created sheet to "NewSheet-01", "NewSheet-02" and so on depends on the user's input number.

    and when i delete them
    When the macro above is run for the second time, it will fail if we don't delete ALL the created sheets first.
    If we delete NOT ALL the created sheets first, then the macro will also fail.
    If we delete ALL the created sheets first, then the macro will create a new sheet with a name (again) "NewSheet-01", "NewSheet-02" and so on depends on the user's input number.

    Got an idea after reading Keebellah post .
    If you want to just add a new sheet again :
    Please Login or Register  to view this content.
    So for example, after run the macro for the first time, the result is "NewSheet-01", "NewSheet-02" and "NewSheet-03".

    If for example we delete just the "NewSheet-02",
    the macro won't create "NewSheet-02", it just continue after the max number of the sheet name.
    The next time the macro run, it will create the new sheet with the next number : "NewSheet-04", "NewSheet-05" and so on.
    So now the existing created sheets name are "NewSheet-01", "NewSheet-03", "NewSheet-04", "NewSheet-05" and so on.

    If for example we delete just the "NewSheet-03",
    The next time the macro run, it will create the new sheet with the next number : "NewSheet-03", "NewSheet-04" and so on.
    So now the existing created sheets name are "NewSheet-01", "NewSheet-02", "NewSheet-03", "NewSheet-04" and so on.

    In other words, the macro won't create the sheet's name with the "lost" sheet number in between.
    Last edited by karmapala; 06-01-2020 at 05:41 PM.

  11. #11
    Forum Expert Keebellah's Avatar
    Join Date
    01-12-2014
    Location
    The Netherlands
    MS-Off Ver
    Office 2021 (Windows)
    Posts
    7,905

    Re: Creating a custom workbook

    Or you add a test if it exists you create a new one with the next number

  12. #12
    Forum Expert Keebellah's Avatar
    Join Date
    01-12-2014
    Location
    The Netherlands
    MS-Off Ver
    Office 2021 (Windows)
    Posts
    7,905

    Re: Creating a custom workbook

    Something like this but it doesn't fill the gaps

    Please Login or Register  to view this content.
    Last edited by Keebellah; 06-01-2020 at 05:37 PM. Reason: correction

  13. #13
    Registered User
    Join Date
    06-01-2020
    Location
    Derbyshire
    MS-Off Ver
    Office 365
    Posts
    36

    Re: Creating a custom workbook

    Quote Originally Posted by Keebellah View Post
    What's in that file?
    The file will be a test report, so air flow readings, duct velocities, photographs, and schematic drawings of the system tested.

    Public Sub testAddSheets()
    Dim myAnswer As Variant
    Dim x As Integer
    Dim s As Integer
    Dim p As Integer
    Dim n As Integer
    Dim i As Integer
    Dim ws As Worksheet
    Dim wsN As Worksheet
    myAnswer = Application.InputBox("type how many sheets you require", Type:=1)
    x = CInt(myAnswer)
    If x = 0 Then Exit Sub
    For Each ws In Worksheets
    If Left(ws.Name, 9) = "NewSheet-" Then
    p = WorksheetFunction.Max(p, Val(Right(ws.Name, 2)))
    End If
    Next ws
    For i = 1 To x
    p = p + 1
    If p = 1 Then
    Sheets.Add After:=Sheets(1)
    ActiveSheet.Name = "NewSheet-" & Format(p, "00")
    Else
    Sheets.Add After:=Sheets("NewSheet-" & Format(p - 1, "00"))
    ActiveSheet.Name = "NewSheet-" & Format(p, "00")
    End If
    Next i

    End Sub

    I have a dedicated sheet set up for a capture point, rather than creating a blank sheet from from this code can the sheet i created be made instead?

  14. #14
    Forum Expert Keebellah's Avatar
    Join Date
    01-12-2014
    Location
    The Netherlands
    MS-Off Ver
    Office 2021 (Windows)
    Posts
    7,905

    Re: Creating a custom workbook

    What sheet? The answer is yes but then don’t let us guess or make incorrect assumptions
    Sample workbook and tell us exactly what and how and also the new sheet’s babe you want to allocate etc etc etc

  15. #15
    Valued Forum Contributor
    Join Date
    11-04-2018
    Location
    Denpasar
    MS-Off Ver
    Excel 2010
    Posts
    777

    Re: Creating a custom workbook

    I'm sorry as I don't understand your situation.

    Quote Originally Posted by mattsporter View Post

    I have a dedicated sheet set up for a capture point,
    rather than creating a blank sheet from from this code can the sheet i created be made instead?

    displays a dialogue box asking how many sheets the user requires
    Who is going to create the sheet ?
    Is it you ? or someone else ?

    I thought the situation is like this :
    There is a workbook with you.
    This workbook will be shared to someone else.
    What you want is that someone else who open the workbook can just click a button (with a macro you've made before hand which you ask in this forum now), enter the number on how many sheets that someone else requires.

    But it seems what I thought is not correct,
    because it seems that it's only you who will click that button ?

    Also, I think you haven't told us how you want the created sheet to be named after you enter the number of sheets required ?

    Sorry for my confusion.

  16. #16
    Forum Expert Keebellah's Avatar
    Join Date
    01-12-2014
    Location
    The Netherlands
    MS-Off Ver
    Office 2021 (Windows)
    Posts
    7,905

    Re: Creating a custom workbook

    @karmapal: not your confusion, the OP has not told us anything, leaving it all to assumptions and guesswork
    Let's wait for the OP to answer

  17. #17
    Valued Forum Contributor
    Join Date
    11-04-2018
    Location
    Denpasar
    MS-Off Ver
    Excel 2010
    Posts
    777

    Re: Creating a custom workbook

    @Keebellah,

    Yes, better wait the OP answer with more detail of his situation.

    Thank you Keebellah .

  18. #18
    Registered User
    Join Date
    06-01-2020
    Location
    Derbyshire
    MS-Off Ver
    Office 365
    Posts
    36

    Re: Creating a custom workbook

    Hi There,

    sorry about the confusion, i thought i'd been as clear as i possibly could. I have attached a sample doc for you to look at.

    As i asked before, i wanted to a be able to generate as many capture point sheets as the user required.
    Attached Files Attached Files

  19. #19
    Forum Expert Keebellah's Avatar
    Join Date
    01-12-2014
    Location
    The Netherlands
    MS-Off Ver
    Office 2021 (Windows)
    Posts
    7,905

    Re: Creating a custom workbook

    Okay, now we have a basic idea.
    This workbook contains three worksheets one of which is the worksheet named 'CapturePoint' that makes sense.
    So to be sure I (we all) get it correctly, you want a button that a user can click to create an X number of copies of the CapturePoint sheet, correct?
    I suggest then that this sheet remains as a blank template and is copied, what's the name do you want to give these new sheets? CapturePoint-001 -002 etc? or an entirely other name?
    Another thing, a user deletes one of these worksheets, let's say het / she has 5 and deletes the 4th sheet, when adding replace that missing sheet to keep the numbers in line or just add the first next hightest number is the worksheets are numbered?
    You see how your 'simple' question has more options if you think a little further.

  20. #20
    Registered User
    Join Date
    06-01-2020
    Location
    Derbyshire
    MS-Off Ver
    Office 365
    Posts
    36

    Re: Creating a custom workbook

    Quote Originally Posted by Keebellah View Post
    blank template and is copied, what's the name do you want to give these new sheets? CapturePoint-001 -002 etc? or an entirely other name?
    Capture point 1, Capture point 2, etc..

    the Blank template you are talking about, can this also have the formulas in it as well for calculations.
    Would they be generated every time someone decided to say, generate 5 capture point pages?

  21. #21
    Forum Expert Keebellah's Avatar
    Join Date
    01-12-2014
    Location
    The Netherlands
    MS-Off Ver
    Office 2021 (Windows)
    Posts
    7,905

    Re: Creating a custom workbook

    I placed my modified code in this sample sheet
    Attached Files Attached Files

  22. #22
    Forum Expert Keebellah's Avatar
    Join Date
    01-12-2014
    Location
    The Netherlands
    MS-Off Ver
    Office 2021 (Windows)
    Posts
    7,905

    Re: Creating a custom workbook

    What formulas? I used Capture poit-001, -002 etc, hadn't seen your message yet, you just need to change the copy and not use the format command or the dash I placed

  23. #23
    Forum Expert Keebellah's Avatar
    Join Date
    01-12-2014
    Location
    The Netherlands
    MS-Off Ver
    Office 2021 (Windows)
    Posts
    7,905

    Re: Creating a custom workbook

    I changed the numbering for you, it's a little more complicated than what I told you
    Attached Files Attached Files

  24. #24
    Registered User
    Join Date
    06-01-2020
    Location
    Derbyshire
    MS-Off Ver
    Office 365
    Posts
    36

    Re: Creating a custom workbook

    No worries, when i pressed the generate button a new capture point template is made and so is the formulas which is great. thank you there is more code there then i could have imagined.

    i tried to hide the master capture point template as i don't want this been seen so only the ones generated are seen but when i hide it they all seem to hide as well. is this something i can do? or is it down to programming again?

  25. #25
    Forum Expert Keebellah's Avatar
    Join Date
    01-12-2014
    Location
    The Netherlands
    MS-Off Ver
    Office 2021 (Windows)
    Posts
    7,905

    Re: Creating a custom workbook

    Yes, it comes down to programming and know how VBA and Excel works
    Attached Files Attached Files

  26. #26
    Forum Expert Keebellah's Avatar
    Join Date
    01-12-2014
    Location
    The Netherlands
    MS-Off Ver
    Office 2021 (Windows)
    Posts
    7,905

    Re: Creating a custom workbook

    Off to bed her now

  27. #27
    Registered User
    Join Date
    06-01-2020
    Location
    Derbyshire
    MS-Off Ver
    Office 365
    Posts
    36

    Re: Creating a custom workbook

    Hi Keebellah

    Is it possible with a formula, (and i have looked in excel and on youtube) to put a drop down list above that 7x8 grid and have a selection list of either circle,grid,oval so then the user can select either pattern?

    Regards

    Matt

  28. #28
    Forum Expert Keebellah's Avatar
    Join Date
    01-12-2014
    Location
    The Netherlands
    MS-Off Ver
    Office 2021 (Windows)
    Posts
    7,905

    Re: Creating a custom workbook

    What do you want to show, one of the three “ images “ in the data sheet?

  29. #29
    Registered User
    Join Date
    06-01-2020
    Location
    Derbyshire
    MS-Off Ver
    Office 365
    Posts
    36

    Re: Creating a custom workbook

    Yes depending on the system being tested.

    If someone is testing a circular duct, then they can select a the circle and square for grid and so on.

  30. #30
    Forum Expert Keebellah's Avatar
    Join Date
    01-12-2014
    Location
    The Netherlands
    MS-Off Ver
    Office 2021 (Windows)
    Posts
    7,905

    Re: Creating a custom workbook

    When will the choice be made,the moment the worksheet is created or once the user works with it?

  31. #31
    Registered User
    Join Date
    06-01-2020
    Location
    Derbyshire
    MS-Off Ver
    Office 365
    Posts
    36

    Re: Creating a custom workbook

    Once the user works with it.

    I want to be able to change it with the option of a drop down list if possible.

  32. #32
    Forum Expert Keebellah's Avatar
    Join Date
    01-12-2014
    Location
    The Netherlands
    MS-Off Ver
    Office 2021 (Windows)
    Posts
    7,905

    Re: Creating a custom workbook

    Okay, but will the capture points all be for one type in one and the same workbook or will if be different Capture points?
    What I mean to say is that you can post the question as now, how many Capture points and then the next one will be make a choice for either Circle, Grid or Oval and all the new worksheets will be set for that,
    Option 1: all new sheets with no specific choice, blank square
    Option 2: all new sheets for one type of capture point (all x the same)
    Option 3: prompt for each new sheet with a choice 0-3 where 0 is blank, 1 = circle, 2= grid 3 = oval

  33. #33
    Registered User
    Join Date
    06-01-2020
    Location
    Derbyshire
    MS-Off Ver
    Office 365
    Posts
    36
    Quote Originally Posted by Keebellah View Post
    Okay, but will the capture points all be for one type in one and the same workbook or will if be different Capture points?
    What I mean to say is that you can post the question as now, how many Capture points and then the next one will be make a choice for either Circle, Grid or Oval and all the new worksheets will be set for that,
    Option 1: all new sheets with no specific choice, blank square
    Option 2: all new sheets for one type of capture point (all x the same)
    Option 3: prompt for each new sheet with a choice 0-3 where 0 is blank, 1 = circle, 2= grid 3 = oval
    Option 3, I want to be able to create x amount of capture point sheets and then in some sort of drop down list choose which ever grid reference I want depending on what I am testing.

  34. #34
    Forum Expert Keebellah's Avatar
    Join Date
    01-12-2014
    Location
    The Netherlands
    MS-Off Ver
    Office 2021 (Windows)
    Posts
    7,905

    Re: Creating a custom workbook

    That means you want to do do that independently AFTER the new sheers have been created? That will mean that the Caption point sheets will need event trigger like right click or double click in for example the are above the square and show an input form to enter a number between 0 and 3 included to 'populate' the area below that the range G20:M27

  35. #35
    Registered User
    Join Date
    06-01-2020
    Location
    Derbyshire
    MS-Off Ver
    Office 365
    Posts
    36
    Quote Originally Posted by Keebellah View Post
    That means you want to do do that independently AFTER the new sheers have been created? That will mean that the Caption point sheets will need event trigger like right click or double click in for example the are above the square and show an input form to enter a number between 0 and 3 included to 'populate' the area below that the range G20:M27
    How do I do that then?

  36. #36
    Forum Expert Keebellah's Avatar
    Join Date
    01-12-2014
    Location
    The Netherlands
    MS-Off Ver
    Office 2021 (Windows)
    Posts
    7,905

    Re: Creating a custom workbook

    I think I have an idea, but let me think it over.
    Will be easier to show than explaining.

  37. #37
    Forum Expert Keebellah's Avatar
    Join Date
    01-12-2014
    Location
    The Netherlands
    MS-Off Ver
    Office 2021 (Windows)
    Posts
    7,905

    Re: Creating a custom workbook

    Here's the updated file:
    Three macro shortcuts added:
    Ctrl + a to add worksheets
    Ctrl + x to select the type of capture (only works if capture point sheet is active and at least 1 present
    Ctrl + j to show a popup to select a worksheet to jump to (handy when you've got many
    Attached Files Attached Files

  38. #38
    Registered User
    Join Date
    06-01-2020
    Location
    Derbyshire
    MS-Off Ver
    Office 365
    Posts
    36

    Re: Creating a custom workbook

    Thank you, that is some great work.

    Is it possible to assign the Ctrl - x to a button I have placed in the capture form.

    Also is it possible when you create a capture sheet the number corresponding to that sheet e.g. (Capture point 1) also gets added to the top left corner of that sheet where it says capture point.

    Regards

    Matt.
    Attached Files Attached Files

  39. #39
    Forum Expert Keebellah's Avatar
    Join Date
    01-12-2014
    Location
    The Netherlands
    MS-Off Ver
    Office 2021 (Windows)
    Posts
    7,905

    Re: Creating a custom workbook

    Welk, now’s the time to pickup on your vba
    Ik you already have the button, right click and adding macro, then select this workbook in the dialogue and the corresponding macro, that’s how it’s done,
    And yes, you can add the line of code in the section once the new sheet is named to place the value op p on the cell , I was already wondering why you hadn’t mantilles this before but I left that for you to think about, if you get stuck ... let me know but it won’t hurt to try, that’s all what coding and programming is about, trial an error and you’ll remember better than just being given the results

  40. #40
    Registered User
    Join Date
    06-01-2020
    Location
    Derbyshire
    MS-Off Ver
    Office 365
    Posts
    36
    I'll give that a go, thank you, you've been a great help.

  41. #41
    Registered User
    Join Date
    06-01-2020
    Location
    Derbyshire
    MS-Off Ver
    Office 365
    Posts
    36

    Re: Creating a custom workbook

    Apologises, I had already tried what you'd suggested before i asked. but now i see the issue. I was attempting to test the macro on the template but it wasn't working, i created a capture point sheet and retested and found that it now does work. so thank you. My mistake.

    I have ordered a VBA for dummies as well to help me pick on VBA as quick as i can.

  42. #42
    Forum Expert Keebellah's Avatar
    Join Date
    01-12-2014
    Location
    The Netherlands
    MS-Off Ver
    Office 2021 (Windows)
    Posts
    7,905

    Re: Creating a custom workbook

    I suggest you check-out the different tutorials where you can get scraps of vba code snippets to test.
    The best way is like we all started, record a macro and then edit it and make it do more.
    Some very important ingredients are Time, patience and imagination, I started like that no courses, jus doing it; but that was in and around 1995 when VBA was not fully implemented yet
    Let me know if you got the numbering working

  43. #43
    Registered User
    Join Date
    06-01-2020
    Location
    Derbyshire
    MS-Off Ver
    Office 365
    Posts
    36

    Re: Creating a custom workbook

    One thing I am having an issue with is, when i lock down the sheets to protect the form, i cannot produce a new grid. keeps informing me that the sheet is locked. I have tried multiple ways around this, is there something that i can do as a work around?

  44. #44
    Registered User
    Join Date
    06-01-2020
    Location
    Derbyshire
    MS-Off Ver
    Office 365
    Posts
    36

    Re: Creating a custom workbook

    Quote Originally Posted by Keebellah View Post
    I suggest you check-out the different tutorials where you can get scraps of vba code snippets to test.
    The best way is like we all started, record a macro and then edit it and make it do more.
    Some very important ingredients are Time, patience and imagination, I started like that no courses, jus doing it; but that was in and around 1995 when VBA was not fully implemented yet
    Let me know if you got the numbering working

    I have been pulling bits of code from the internet to help me with this as well as your help.

    regarding the getting the number thing i am trying this at the moment.

    Please Login or Register  to view this content.
    and then using =SHEETNAME(3)

  45. #45
    Registered User
    Join Date
    06-01-2020
    Location
    Derbyshire
    MS-Off Ver
    Office 365
    Posts
    36

    Re: Creating a custom workbook

    No worries, sorted the number situation out.

    Please Login or Register  to view this content.

  46. #46
    Forum Expert Keebellah's Avatar
    Join Date
    01-12-2014
    Location
    The Netherlands
    MS-Off Ver
    Office 2021 (Windows)
    Posts
    7,905

    Re: Creating a custom workbook

    You never mentions locked / protected worksheet, and which cells have to remain unlocked?
    There’s more to it than just what you’re telling me, and the number , I don’t understand why the formula with MID and so, unless there’s more to your question than you’ve told me

  47. #47
    Registered User
    Join Date
    06-01-2020
    Location
    Derbyshire
    MS-Off Ver
    Office 365
    Posts
    36
    I didn't realize until today how easy it would be to fill in the wrong form and delete a formula.

    That number thing does work.

  48. #48
    Forum Expert Keebellah's Avatar
    Join Date
    01-12-2014
    Location
    The Netherlands
    MS-Off Ver
    Office 2021 (Windows)
    Posts
    7,905

    Re: Creating a custom workbook

    Tell me which cells are the unlocked cells in the Capture point form and do you want to lock the worksheet with a password? Then which one?

  49. #49
    Registered User
    Join Date
    06-01-2020
    Location
    Derbyshire
    MS-Off Ver
    Office 365
    Posts
    36
    Quote Originally Posted by Keebellah View Post
    Tell me which cells are the unlocked cells in the Capture point form and do you want to lock the worksheet with a password? Then which one?
    When I protect the forms I cannot creat a grid

  50. #50
    Forum Expert Keebellah's Avatar
    Join Date
    01-12-2014
    Location
    The Netherlands
    MS-Off Ver
    Office 2021 (Windows)
    Posts
    7,905

    Re: Creating a custom workbook

    That doesn’t answer my question!!!

  51. #51
    Registered User
    Join Date
    06-01-2020
    Location
    Derbyshire
    MS-Off Ver
    Office 365
    Posts
    36
    I wanted to lock the capture point sheet

  52. #52
    Forum Expert Keebellah's Avatar
    Join Date
    01-12-2014
    Location
    The Netherlands
    MS-Off Ver
    Office 2021 (Windows)
    Posts
    7,905

    Re: Creating a custom workbook

    I understand that much, but; hope I don't sound to condescending, you see, when you lock a worksheet, you can choose which cells remain unlocked so that users can enter values, which I imagine is what you do here.
    Locking worksheets is generally just for that, only leave open (unlocked) those cell where user input by keyboard or dropdown lists is permitted, the rest is locked, this will also avoid the fact that users may then accidentally remove or change formulas
    Of course I can think and figure out which cells you want unlocked, the rest will be locked.
    This is what I mean when I say 'Which cells have to remain unlocked" and yes when you paste the grid, that area will be special because is the entire grid unlocked or with the circle only the blocked cells as well as with the oval.
    Hope you catch my idea

  53. #53
    Forum Expert Keebellah's Avatar
    Join Date
    01-12-2014
    Location
    The Netherlands
    MS-Off Ver
    Office 2021 (Windows)
    Posts
    7,905

    Re: Creating a custom workbook

    This this one

    Manually unprotect: the password is 1234 but the macros take care of that
    Attached Files Attached Files

  54. #54
    Registered User
    Join Date
    06-01-2020
    Location
    Derbyshire
    MS-Off Ver
    Office 365
    Posts
    36

    Re: Creating a custom workbook

    That kind of worked, but the create grid button vanished.

    Question. Can all this be implemented into a actually custom program. I ask because I think it would be better than an Excel sheet.

  55. #55
    Forum Expert Keebellah's Avatar
    Join Date
    01-12-2014
    Location
    The Netherlands
    MS-Off Ver
    Office 2021 (Windows)
    Posts
    7,905

    Re: Creating a custom workbook

    What button? Didn’t see any button.
    What do you mean with “ Actual program“?
    This is Excel

  56. #56
    Registered User
    Join Date
    06-01-2020
    Location
    Derbyshire
    MS-Off Ver
    Office 365
    Posts
    36

    Re: Creating a custom workbook

    The button that was set on the above the capture grid which i assigned a macro Ctrl + X to open the input box to select which ever grid the user wanted.

    I mean can this be done as an actual standalone program from VBA?

  57. #57
    Forum Expert Keebellah's Avatar
    Join Date
    01-12-2014
    Location
    The Netherlands
    MS-Off Ver
    Office 2021 (Windows)
    Posts
    7,905

    Re: Creating a custom workbook

    Yes, I told you I had already assigned the shortcut button to this, you don't need a button just press Ctrl x when you're in one of the Capture sheets!

    That so difficult?
    Ctrl + m to as if you want to generate more
    Ctrl + j to see a list of worksheets to select one to activate

  58. #58
    Registered User
    Join Date
    06-01-2020
    Location
    Derbyshire
    MS-Off Ver
    Office 365
    Posts
    36

    Re: Creating a custom workbook

    Apologises, i had been working away.

    The reason i added a button was because some people are not that good with excel, am building this for me, but i know it will get out and other people will want it, so have thinking ahead.
    This is why i added a button.

  59. #59
    Forum Expert Keebellah's Avatar
    Join Date
    01-12-2014
    Location
    The Netherlands
    MS-Off Ver
    Office 2021 (Windows)
    Posts
    7,905

    Re: Creating a custom workbook

    Did you manage to place the button again ?

  60. #60
    Registered User
    Join Date
    06-01-2020
    Location
    Derbyshire
    MS-Off Ver
    Office 365
    Posts
    36

    Re: Creating a custom workbook

    to be honest i'd not had chance, but while i was away i'd been working on the form in my hotel room and managed to incorporate a equation into the capture point which should help on results.

    Sorted some more formula's out and tided up the margins.

  61. #61
    Forum Expert Keebellah's Avatar
    Join Date
    01-12-2014
    Location
    The Netherlands
    MS-Off Ver
    Office 2021 (Windows)
    Posts
    7,905

    Re: Creating a custom workbook

    If you want me to place the button for you on the sheet(s) just mail me your most recent version so your changes don't get lost

  62. #62
    Registered User
    Join Date
    06-01-2020
    Location
    Derbyshire
    MS-Off Ver
    Office 365
    Posts
    36

    Re: Creating a custom workbook

    What i did want was to add another capture grid called partial enclosure. i have managed so far with this.

    Please Login or Register  to view this content.
    and

    Please Login or Register  to view this content.
    But i am struggling to see how you assigned the actual grid to the code.

  63. #63
    Forum Expert Keebellah's Avatar
    Join Date
    01-12-2014
    Location
    The Netherlands
    MS-Off Ver
    Office 2021 (Windows)
    Posts
    7,905

    Re: Creating a custom workbook

    The code snippets you have posted don't tell me anything and I do not understand the 'partial enclosure'????
    It's way past my bedtime here so hope you can enlighten me better tomorrow
    If you look at the vba code Y used you can see how the grid code has been asigned

  64. #64
    Registered User
    Join Date
    06-01-2020
    Location
    Derbyshire
    MS-Off Ver
    Office 365
    Posts
    36

    Re: Creating a custom workbook

    here is the full code.

    Please Login or Register  to view this content.
    and then i edited this

    Please Login or Register  to view this content.
    hope this helps

  65. #65
    Forum Expert Keebellah's Avatar
    Join Date
    01-12-2014
    Location
    The Netherlands
    MS-Off Ver
    Office 2021 (Windows)
    Posts
    7,905

    Re: Creating a custom workbook

    Look code looks fine. But again WHAT is it you want to achieve?
    What you haven't explained is what is CPARTIAL? how does it look?
    o you have a named range named CPARTIAL.
    I said it once, I don't go for guessing or assumptions.

    Or you attach a copy of your workbook or we leave it as it is and hope you can figure it out

  66. #66
    Registered User
    Join Date
    06-01-2020
    Location
    Derbyshire
    MS-Off Ver
    Office 365
    Posts
    36

    Re: Creating a custom workbook

    here is a copy of the newest form so far with edited code,
    I wanted the partial enclosure added to the capture grid. if you could tell me rather do the editing if you prefer that.
    Attached Files Attached Files

  67. #67
    Forum Expert Keebellah's Avatar
    Join Date
    01-12-2014
    Location
    The Netherlands
    MS-Off Ver
    Office 2021 (Windows)
    Posts
    7,905

    Re: Creating a custom workbook

    It's clear that you did not really take a look at what the CPCIRCLE CPOVAL CPGRID stand for.
    You deleted FGOVAL and so but that wasn't necessary.
    The entire square on the datasheet is a named range such also now CPPARTIAL
    THAT is what the code copies and does, and the button you wanted add (which isn't there); you did though create Module1 in it with an empty Button_Click.
    You don't need to do that the macro is already there (with the shortcut key, but okay, the shortcut key still works all you need to is add a shape a button whatever object you want and assign that macro which is triggered but the shortcut key.

    On thing you have to do is in the Data sheet format the squares that have to be unlocked, you've got them all locked so if you do decide to protect the Caption point sheets then you will not be able to enter anything in that area if you select the Partial
    I assumed that the dark coloured cells should be the unlocked ones like the oval and the circle but ... maybe that's incorrect.

    I didn't do much to the code except resetting the delete part which you modified to it's original code and and added the CPPARTIAL range with you integrated nicely in the macro but failed to complete

    Here's the file, made it V1 and I added a shape so that it's on each Capture point sheet, maybe you want to make it smaller (you'll have to reduce the font size too) but do that in the hidden Capture point sheet
    Attached Files Attached Files

  68. #68
    Registered User
    Join Date
    06-01-2020
    Location
    Derbyshire
    MS-Off Ver
    Office 365
    Posts
    36

    Re: Creating a custom workbook

    I know i requested last time to add protection for the capture sheet so only certain cells can edited.

    is it possible to lock down and hide all cells that have formulas in them this would include anything from the front sheet to the capture sheet.
    At the same time not cause any issues with generating a capture reference such as "Circle" "Grid" etc... i still want to be able to generate them,
    and edit the cells from the capture point.

    I have also found a little bit of script on here so i can press a button and generate a number in the footer of the all the pages generated.

    New form attached.
    Attached Files Attached Files

  69. #69
    Forum Expert Keebellah's Avatar
    Join Date
    01-12-2014
    Location
    The Netherlands
    MS-Off Ver
    Office 2021 (Windows)
    Posts
    7,905

    Re: Creating a custom workbook

    Like I mentioned some time earlier, you can only hide the formulas if the worksheet is protected, that’s a format option you can see in the cell format protection tab
    I’m away now so cannot download your file to see the code snippet, and you do not need any code for that, just setup the page footer format to show the worksheet’s tab name and the page number

  70. #70
    Forum Expert Keebellah's Avatar
    Join Date
    01-12-2014
    Location
    The Netherlands
    MS-Off Ver
    Office 2021 (Windows)
    Posts
    7,905

    Re: Creating a custom workbook

    Hi Matt, I downloaded your file with your modified layout, looks good, I would however correct your page layout for printing, the front page should be scaled as fit to page; the capture sheets should also be scaled fit to page but in landscape instead of portrait
    You should select all cells where you want to permit manual changes and format these as unlocked and NOT check the hidden box, the rest as locked and hidden.
    Lock the worksheets with the macro with the extra parameter Userinterfaceonly:=True, this permits macros to make changes without having to unprotect the worksheet.
    You will have to check if the options to insert / paste pictures or photos is permitted
    You could also add a userform with which you can select a picture or photo and have the macro take care of placing and scaling the image in the correct place

  71. #71
    Forum Expert Keebellah's Avatar
    Join Date
    01-12-2014
    Location
    The Netherlands
    MS-Off Ver
    Office 2021 (Windows)
    Posts
    7,905

    Re: Creating a custom workbook

    I worked a little on the layout, see if it's to your liking (see the print preview)

    Haven't done anything about the load photographs, will await to hear what ideas you had in mind.
    Attached Files Attached Files

  72. #72
    Registered User
    Join Date
    06-01-2020
    Location
    Derbyshire
    MS-Off Ver
    Office 365
    Posts
    36

    Re: Creating a custom workbook

    Thank you, but with regards to the capture point and fletchers nomogram they cant always be used together.

    You can only use fletchers when testing a receiving hood such such with an aperture of a cicrle, grid, or oval.

    i think i have sorted everything out.

    There is one thing i cannot find out there, I am trying to count the amount of capture point sheets and place that number in the third box down on the front page call #capture points, is there a way of doing this?

  73. #73
    Forum Expert Keebellah's Avatar
    Join Date
    01-12-2014
    Location
    The Netherlands
    MS-Off Ver
    Office 2021 (Windows)
    Posts
    7,905

    Re: Creating a custom workbook

    See the code that I wrote to add a new worksheet, there is a loop that loops through all worksheets with the string cpsheet in the name and setting the max cnt , the max value tells you how many Capture point worksheets are present

  74. #74
    Registered User
    Join Date
    06-01-2020
    Location
    Derbyshire
    MS-Off Ver
    Office 365
    Posts
    36

    Re: Creating a custom workbook

    Ah right i'll point it to that

  75. #75
    Registered User
    Join Date
    06-01-2020
    Location
    Derbyshire
    MS-Off Ver
    Office 365
    Posts
    36

    Re: Creating a custom workbook

    Could you take a look i have already had this working today where i had locked and hidden everything down and could still edit the capture grids and specific cells.

    For some reason it's not working now, i don't know what i have done.
    Attached Files Attached Files

  76. #76
    Forum Expert Keebellah's Avatar
    Join Date
    01-12-2014
    Location
    The Netherlands
    MS-Off Ver
    Office 2021 (Windows)
    Posts
    7,905

    Re: Creating a custom workbook

    I’ll take a look in a moment

  77. #77
    Forum Expert Keebellah's Avatar
    Join Date
    01-12-2014
    Location
    The Netherlands
    MS-Off Ver
    Office 2021 (Windows)
    Posts
    7,905

    Re: Creating a custom workbook

    Can you explain what isn't working?
    Is it the MAcro1?

    In this case you made an error in the way you've written it

    Please Login or Register  to view this content.
    The UserInterfaceonly is parameter NOT a variable

  78. #78
    Forum Expert Keebellah's Avatar
    Join Date
    01-12-2014
    Location
    The Netherlands
    MS-Off Ver
    Office 2021 (Windows)
    Posts
    7,905

    Re: Creating a custom workbook

    What's the 'Fan Check Sheet'?

  79. #79
    Registered User
    Join Date
    06-01-2020
    Location
    Derbyshire
    MS-Off Ver
    Office 365
    Posts
    36

    Re: Creating a custom workbook

    The systems i test are connected to fan motors, so we have to record all information about the fan, make, model, type, power, RPM, Kilowatts, AMPS, direction, etc etc... that will be the last form in this venture. hopefully.

  80. #80
    Registered User
    Join Date
    06-01-2020
    Location
    Derbyshire
    MS-Off Ver
    Office 365
    Posts
    36

    Re: Creating a custom workbook

    You asked me to assign that parameter to a macro. I made a macro setting the password and then added that in there. but it wasn't working.

  81. #81
    Forum Expert Keebellah's Avatar
    Join Date
    01-12-2014
    Location
    The Netherlands
    MS-Off Ver
    Office 2021 (Windows)
    Posts
    7,905

    Re: Creating a custom workbook

    I don't / didn't see the macro with the password in your file.
    You recorded the Macro1 I saw, but this one has no password, I did show you the code where the UserIntefaceOnly para meter goes, you had plced it a UserInterfaseOnly= true as a lose line of code.
    That's not the way.

+ 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] Need help creating custom format with VBA
    By lynnsong986 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 01-10-2020, 10:28 AM
  2. Custom Tab is not creating in 2007
    By narendrabr in forum Excel Programming / VBA / Macros
    Replies: 16
    Last Post: 01-13-2014, 11:15 AM
  3. Help creating a custom bar graph?
    By erosenzweig in forum Excel Charting & Pivots
    Replies: 2
    Last Post: 01-24-2012, 05:26 PM
  4. Creating a custom function
    By Saut1 in forum Excel General
    Replies: 2
    Last Post: 03-23-2009, 11:29 AM
  5. Creating Custom Function - A Little Help Please!
    By Paige in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 08-17-2006, 05:00 AM
  6. Creating custom face ID's
    By Karoo News in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 08-19-2005, 11:05 AM
  7. Creating an custom input box
    By [email protected] in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 03-17-2005, 12:06 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