+ Reply to Thread
Results 1 to 12 of 12

Auto-populate column based on another column

  1. #1
    Registered User
    Join Date
    01-02-2011
    Location
    Salem
    MS-Off Ver
    Excel 2003
    Posts
    9

    Arrow Auto-populate column based on another column

    Hi there,

    Actually I was trying to create an Excel document, whose primary purpose is Just Billing and printing. Everything that i made in it was working fine except few things.

    All I want is, When I select the "Particulars" from the list, I want the "Unit Price" to be auto populated.

    For example, If the "Particulars" is selected as "Shirt - 250", I want the "Unit price to be automatically filled with "250".
    and one more thing thats really bugging me is, I want someone to help me generate the "Total Price" ( I11 Col ) by multiplying "Unit Price" with "Quantity", and i want this to be generated automatically when the "Quantity is filled by the user".

    Everything is working fine before i hit the "New Invoice", then it moves away...

    I even tried locking the cells containing the formulas, but still the same issue. I want all the transactions to be saved in the Sales sheet.

    I am looking forward for Excel Geeks, who can fix this for me,...

    Thanks in advance....
    Attached Files Attached Files
    Last edited by technocrawl; 01-03-2011 at 12:37 AM. Reason: Doesnt comply to Rule

  2. #2
    Registered User
    Join Date
    01-02-2011
    Location
    Manchester
    MS-Off Ver
    Excel 2010
    Posts
    31

    Re: Excel Experts FIX this.....

    Hi Putting the following line of code in the unit price cell will give you the unit price

    =IF(B12="","",TRIM(RIGHT(B12,LEN(B12)-SEARCH("-",B12))))

    I used simple IF to check if cell is blank to avoid the value error there are other ways to error trap but this will do - for Total Price you can time unit price by quantity.

    Hope this helps!

  3. #3
    Registered User
    Join Date
    01-02-2011
    Location
    Manchester
    MS-Off Ver
    Excel 2010
    Posts
    31

    Re: Excel Experts FIX this.....

    One more thing when clicking new invoice I suggest you only clear cells that require input therefore not deleting your formulas example below would clear any content from the chosen range. You can use more VBA to pre-populate the rows in your "Sale" sheet and use the offset to move to a new row.

    Private Sub CommandButton1_Click()
    Range("B12:B26").Select
    Selection.ClearContents

    End Sub

  4. #4
    Forum Expert
    Join Date
    10-06-2008
    Location
    Canada
    MS-Off Ver
    2007 / 2013
    Posts
    5,697

    Re: Excel Experts FIX this.....

    technocrawl

    I am certainly not and expert and I also don't think I am a geek but

    In column H you could try:

    Please Login or Register  to view this content.
    or

    Please Login or Register  to view this content.
    and in column I try:

    Please Login or Register  to view this content.
    Hope it works until someone with a better solution comes around.

    Good luck and all the best wishes for 2011

    John

  5. #5
    Forum Expert
    Join Date
    12-23-2006
    Location
    germany
    MS-Off Ver
    XL2003 / 2007 / 2010
    Posts
    6,326

    Re: Excel Experts FIX this.....

    Jolivanes, I'm sorry but

    Your post does not comply with Rule 7 of our Forum RULES. Please do not ignore Moderators' or Administrators' requests - note that this includes requests by senior members as well, if you are unclear about their request or instruction then send a private message to them asking for help. Do not post a reply to a thread where a moderator has requested an action that has not been complied with e.g Title change or Code tags...etc

  6. #6
    Forum Expert
    Join Date
    10-06-2008
    Location
    Canada
    MS-Off Ver
    2007 / 2013
    Posts
    5,697

    Re: Excel Experts FIX this.....

    arthurbr
    First of all, a Happy New Year and all the best wishes for 2011.
    To the best of my knowledge, there was no restriction yet on the thread I answered to but if there was, my apologies.

  7. #7
    Forum Expert
    Join Date
    12-23-2006
    Location
    germany
    MS-Off Ver
    XL2003 / 2007 / 2010
    Posts
    6,326

    Re: Excel Experts FIX this.....

    Jolivanes, thx for the wishes and may 2011 be wonderful for you.
    I suppose that you did not ( as we all sometimes do) refresh your page before posting.

    So, in the spirit of New Year, I will reverse the infraction., just for this time. Don't forget to hit F5 in the future :-)

  8. #8
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2010, 2019
    Posts
    40,689

    Re: Excel Experts FIX this.....

    Wow, Arthur, pardons are usually dispensed before Christmas

    Sin no more, John ...
    Entia non sunt multiplicanda sine necessitate

  9. #9
    Forum Expert
    Join Date
    10-06-2008
    Location
    Canada
    MS-Off Ver
    2007 / 2013
    Posts
    5,697

    Re: Excel Experts FIX this.....

    Arthur.
    Indeed, I did not.
    Thank you for the kind spirit.

    shg.
    Too old be a sinner!!!!

    All the best to all of you for 2011

  10. #10
    Forum Expert mikerickson's Avatar
    Join Date
    03-30-2007
    Location
    Davis CA
    MS-Off Ver
    Excel 2011
    Posts
    6,229

    Re: Excel Experts FIX this.....

    Quote Originally Posted by jolivanes View Post
    ...Too old be a sinner!!!!
    Nonsense! Try harder!

    Happy New Year!
    _
    ...How to Cross-post politely...
    ..Wrap code by selecting the code and clicking the # or read this. Thank you.

  11. #11
    Forum Expert
    Join Date
    10-06-2008
    Location
    Canada
    MS-Off Ver
    2007 / 2013
    Posts
    5,697

    Re: Excel Experts FIX this.....

    Is that an expert talking Mike?
    Maybe I should have worded as "Too Old To Be A Consistent Sinner"
    Happy days to you also Mike

  12. #12
    Registered User
    Join Date
    01-02-2011
    Location
    Salem
    MS-Off Ver
    Excel 2003
    Posts
    9

    Re: Auto-populate column based on another column

    Thanks a Lot folks, I finally solved the problem with your kind help and little more messing with the dynamic lists....

    Now I am in the final stage guys, but still one more problem is there, I think its bit easy to solve this issue, but i am looking for VBA code from the experts to calculate the "Total Price", by automatically taking the values of "Unit price" and "Quantity". I dont want to do this with any sorta formulas, I am only looking for the VB code, that helps fix this issue and I dont want to calculate the "Total Price" manually.

    Find the Excel file that i am dealing with in the attachment...

    Thanks in advance...
    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)

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