+ Reply to Thread
Results 1 to 10 of 10

Custom Order Template VBA or Macro

  1. #1
    Registered User
    Join Date
    12-21-2007
    Posts
    20

    Custom Order Template VBA or Macro

    I am trying to write a formula whether it be in VBA or a Macro that will do the following.
    In cell A7 and A10 there are validation boxes that drop down with a list of items that can be selected.
    We want the user to be able to add multiple items under each month but keep the list to only what is needed. Therefor the function I am trying to get is once cell A7 has a selction or isnot blank or is greater than 0 we want to add a line directly below it with all the same functionality as line 7. Everything else will shift down and maintain the same functionality.

    I have a attached a sample workbook... Can this be done and if so any help would be greatly appriciated! Thanks RAH
    Attached Files Attached Files

  2. #2
    Registered User
    Join Date
    12-21-2007
    Posts
    20

    VBA to add row based on selection in validation list

    Can anyone help me with the code on this one? I have bits and pieces but just cant seem to get it together. I would sincerely appriciate your help!
    Thanks
    RAH

  3. #3
    Forum Contributor VBA Noob's Avatar
    Join Date
    04-25-2006
    Location
    London, England
    MS-Off Ver
    xl03 & xl 07(Jan 09)
    Posts
    11,988
    Please read forum rules below and add the link to the cross post

    VBA Noob
    _________________________________________


    Credo Elvem ipsum etian vivere
    _________________________________________
    A message for cross posters

    Please remember to wrap code.

    Forum Rules

    Please add to your signature if you found this link helpful. Excel links !!!

  4. #4
    Registered User
    Join Date
    12-21-2007
    Posts
    20
    I was just going to PM you. I need your help. Sorry I didnt mean to cross post.

  5. #5
    Forum Contributor VBA Noob's Avatar
    Join Date
    04-25-2006
    Location
    London, England
    MS-Off Ver
    xl03 & xl 07(Jan 09)
    Posts
    11,988
    Still no sign of the link ??

    Also need to add to the other forum otherwise it will be locked!!

    VBA Noob

  6. #6
    Registered User
    Join Date
    12-21-2007
    Posts
    20
    Sorry about the cross post. I didnt trully understand what I had done wrong until now. I can totally appriciate this rule. My cross post is at http://www.ozgrid.com/forum/showthread.php?t=86445

    They wont let me post this link there until after 24 hours and I will do just that tomorow when I return.

    Thanks VBA Noob for pointing that issue out.

  7. #7
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,259
    Hello RAH,

    Here is the macro that has been added to your original workbook. The Validation drop down list contains 2 additional entries: a blank and "Add a Line".
    Please Login or Register  to view this content.
    Sincerely,
    Leith Ross
    Attached Files Attached Files

  8. #8
    Registered User
    Join Date
    12-21-2007
    Posts
    20
    Leith,
    Thanks so much for your help. I think I have steped into another world of macros though. When I open the workbook the macro does what I need but I dont see it in the macro list. Is this running in the background somehow??? How do I enter this macro into my workbook? Also, I am not sure what to change so that it copy's everything except values such as the qty. I trully appriciate your time and help on this one.
    Thanks
    RAH

  9. #9
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,259
    Hello RAH,

    The macro is attached to the worksheet to the by its Worksheet_Change event procedure. Whenever a cell's value is changed, the macro runs. I have made a change to blank the quantity when the line is copied. The change is marked in blue.
    Please Login or Register  to view this content.
    How to Save a Worksheet Event Macro
    1. Copy the macro using CTRL+C keys.
    2. Open your Workbook and Right Click on the Worksheet's Name Tab for the Worksheet the macro will run on.
    3. Left Click on View Code in the pop up menu.
    4. Paste the macro code using CTRL+V
    5. Save the macro in your Workbook using CTRL+S

    Sincerely,
    Leith ross

  10. #10
    Registered User
    Join Date
    12-21-2007
    Posts
    20
    Thats fantastic... I trully appriciate the help. Thanks so much!

+ 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