+ Reply to Thread
Results 1 to 13 of 13

update value and edit items already update on sheet by userform

  1. #1
    Registered User
    Join Date
    10-04-2013
    Location
    Bangalore
    MS-Off Ver
    Excel 2007
    Posts
    12

    update value and edit items already update on sheet by userform

    Hi,
    I have work on my first VBA on the attached file. I need help in couple of them. First let me tell what the sheet is all about. I have a sheet on as Item master list that has all the items used in cooking. along with price and broken down to per gram or per ml. the rest of the sheet is the menu costing sheet where items are updated using userform. Now what i want is that in the attached sheet example say on the sheet 1 the value update for "egg" is one dozen ( 12 peice ) Rs.60, which bring the value of 1 egg to Rs.5. Now what i want is if for some reason the egg price should or have gone up say Rs.80 ( 12 peice) so the value for a single has gone up by Rs.6.67. And since there are close to 45-50 sheets where eggs are used its not possible to update every sheet. what code to write so that when i update the value Rs.80 on sheet1 the result for a single peice is reflected on all the sheet where eggs are used.
    Second i also want say in sheet 2 named egg nog milk used is 80 ml but that has to be 100ml. which needs to be corrected. how or what is to be added in the userform so that i can edit the information which out disturbing any other info, and also can be use in any of the sheet to correct such info.

    Thanks in advance
    Attached Files Attached Files

  2. #2
    Registered User
    Join Date
    10-04-2013
    Location
    Bangalore
    MS-Off Ver
    Excel 2007
    Posts
    12

    Re: update value and edit items already update on sheet by userform

    Help me on this one

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

    Re: update value and edit items already update on sheet by userform

    If VBA is used Every time you make changes Macro is to run to update. Instead formula is better Which gives auto correction.
    IN EGGNOGG sheet in Columns F & G Formulas are given.Column F has ARRAY formula.
    To enter array formula
    After pasting formula
    Press F2
    Press Ctrl+Shift+Enter keys

  4. #4
    Registered User
    Join Date
    10-04-2013
    Location
    Bangalore
    MS-Off Ver
    Excel 2007
    Posts
    12

    Re: update value and edit items already update on sheet by userform

    thanks, it worked for me well. Wanted to check on thing, i want to lock and hide the formula in the column F & G ( i.e from F6:G35) and have this code written
    Sub protectmydata()
    Dim strPassword As String
    Range("f6:g35").Select
    Selection.Locked = True
    Selection.FormulaHidden = True
    strPassword = InputBox("Please Enter Password")
    ActiveSheet.Protect Password:=strPassword
    End Sub

    The seems to lock all the cell. I am more interested in changing the value of Column D i.e when i have update the info via user form, there might be chances of editing the Column D. So how can i do that and also want to hide the formula and lock column F & G. So that it dosn't get changed by different user's.

  5. #5
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: update value and edit items already update on sheet by userform

    Hi tjxc32m

    Who can update the Master Sheet?
    John

    If you have issues with Code I've provided, I appreciate your feedback.

    In the event Code provided resolves your issue, please mark your Thread as SOLVED.

    If you're satisfied by any members response to your issue please use the star icon at the lower left of their post.

  6. #6
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: update value and edit items already update on sheet by userform

    Hi tjxc32m

    Try the Code in the attached.

    User can Add New Recipe Items and or change Quantities on existing Items. User cannot modify Price or Cost.

    Price is changed only on the Master List. Changes made on the Master List also update all Recipe Worksheets.

    Password is "password" without the quotes.
    Attached Files Attached Files

  7. #7
    Registered User
    Join Date
    10-04-2013
    Location
    Bangalore
    MS-Off Ver
    Excel 2007
    Posts
    12

    Re: update value and edit items already update on sheet by userform

    Thanks jaslake for the help.
    Since i am new and this my first macro. Wanted to check what is the code that made any value change in the Item master list, reflect the same on all the sheets ( Like egg is peice=12, dozen price =60.00, per peice=5.00 , if i change it to dozen price=80.00, per peice= 6.67 , how does the new value gets update on the sheets where egg is used )
    Also why are the cell D9 and F9 not locked when the sheet is protected !!!
    And is there anyway where in after entering the entire info on a sheet i want to edit the quantity part of my say i want to change it from 8 grms to 10 grms and also the respective change in pricing is also done when the quantity is changed. all this with out unlocking the sheet.

    Is it possible !!

  8. #8
    Registered User
    Join Date
    10-04-2013
    Location
    Bangalore
    MS-Off Ver
    Excel 2007
    Posts
    12

    Re: update value and edit items already update on sheet by userform

    ok jaslake got it. sorry about that.
    why is the cell D9 cell not locked and also F9 cell. It seems both the cells info can be typed, which can change the final pricing. And the focus seems to be set on D9 once i change the sheet.

  9. #9
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: update value and edit items already update on sheet by userform

    Hi tjxc32m

    I'd suggest those cells are not Locked. Unprotect the Sheet, Lock the Cells and Protect the Sheet...Save.

    Regarding this...actually the Code does just that
    i want to edit the quantity part of my say i want to change it from 8 grms to 10 grms and also the respective change in pricing is also done when the quantity is changed. all this with out unlocking the sheet.
    Try it...

    PS: you'll need to check ALL your Worksheets to make certain ALL the Cells are Locked...
    Last edited by jaslake; 11-06-2013 at 02:25 PM.

  10. #10
    Registered User
    Join Date
    10-04-2013
    Location
    Bangalore
    MS-Off Ver
    Excel 2007
    Posts
    12

    Re: update value and edit items already update on sheet by userform

    attached excel sheet
    Attached Files Attached Files

  11. #11
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: update value and edit items already update on sheet by userform

    Hi tjxc32m

    Some of your sheets are protected by an unknown password. What is it?

  12. #12
    Registered User
    Join Date
    10-04-2013
    Location
    Bangalore
    MS-Off Ver
    Excel 2007
    Posts
    12

    Re: update value and edit items already update on sheet by userform

    Sorry about that. The password for ther Item master list is "edolpsgge", and the other sheets its "godspeed". :-)

    Thanks,
    Jolly

  13. #13
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: update value and edit items already update on sheet by userform

    Hi tjxc32m

    In the attached this Code is in ThisWorkbook Module and runs each time the Workbook is opened. It protects each Worksheet with the appropriate Password; the Protection applied allows Macros to run on Protected Worksheets.
    Please Login or Register  to view this content.
    This Code is in "ITEM MASTER LIST" Code Module and allows changes made to "ITEM MASTER LIST" to be populated to all other Worksheets (without unprotecting the other Worksheets). You WILL need to unprotect "ITEM MASTER LIST" to make changes and then protect it after your changes are made.

    You COULD unlock the Cells you wish to change but then they would be available to anyone with access to "ITEM MASTER LIST".
    Please Login or Register  to view this content.
    This Code (revised from your original Code) is in the UserForm and is attached to the Submit Button
    Please Login or Register  to view this content.
    Attached Files Attached Files

+ 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] VBA Userform Edit/Update record help
    By sa.1985 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 11-20-2013, 10:29 AM
  2. Update excel based on userform text box update
    By sivakumar123 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-11-2013, 01:01 AM
  3. [SOLVED] update button on userform does not update all cells in worksheet
    By tutke in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 09-27-2012, 03:07 AM
  4. edit data in userform and update spreadsheet
    By nunans in forum Excel General
    Replies: 2
    Last Post: 03-08-2012, 04:44 AM
  5. Edit/Update list from userform (auto alphabetized)
    By Jogier505 in forum Excel Programming / VBA / Macros
    Replies: 16
    Last Post: 12-07-2009, 06:28 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