+ Reply to Thread
Results 1 to 10 of 10

VBA Help needed to create a document based on user input thru UserForm

  1. #1
    Forum Contributor
    Join Date
    10-30-2011
    Location
    Doha
    MS-Off Ver
    MS office 365
    Posts
    701

    Question VBA Help needed to create a document based on user input thru UserForm

    Folks,

    I have a workbook with three sheets and one userform. The first sheet is contains the master data, and second and third sheets are the document templates. I want to copy values from the userform and paste into the templates and create as a single document in pdf format. Can you please help me to fix the issues? I have attached the excel file of what I'm trying to accomplish.

    Thanks in advance for your expertise!

    Joshi
    Attached Files Attached Files

  2. #2
    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: VBA Help needed to create a document based on user input thru UserForm

    Hi Joshi

    How do you get these answers?

    Y answers.jpg
    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.

  3. #3
    Forum Contributor
    Join Date
    10-30-2011
    Location
    Doha
    MS-Off Ver
    MS office 365
    Posts
    701

    Re: VBA Help needed to create a document based on user input thru UserForm

    Hi John,
    Thanks for your reply, I forgot to add a multi select ListBox for that. If I select fhe answer should be "Y" otherwise keep it "-".
    Thanks,
    Joshi

  4. #4
    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: VBA Help needed to create a document based on user input thru UserForm

    Hi Joshi

    When you've done so post back and I'll take another look at it.

  5. #5
    Forum Contributor
    Join Date
    10-30-2011
    Location
    Doha
    MS-Off Ver
    MS office 365
    Posts
    701

    Re: VBA Help needed to create a document based on user input thru UserForm

    Hi John,

    I have placed a new listbox and attached the latest workbook as advised. Please help me to fix the this document developer.

    Thanks in advance,
    Joshi
    Attached Files Attached Files

  6. #6
    Forum Guru
    Join Date
    03-12-2010
    Location
    Canada
    MS-Off Ver
    2010 and 2013
    Posts
    4,418

    Re: VBA Help needed to create a document based on user input thru UserForm

    Hi Joshi,

    I can't see how the fields in the userform are linked to the cells in the worksheet. Could you give us a list like so:

    Textbox1 >> Sheets("MyFirstSheet").Range("A1")
    Combobox1 >> Sheets("MySecondSheet").Range("B1")

    that way we can help code this.

    abousetta
    Please consider:

    Thanking those who helped you. Click the star icon in the lower left part of the contributor's post and add Reputation.
    Cleaning up when you're done. Mark your thread [SOLVED] if you received your answer.

  7. #7
    Forum Contributor
    Join Date
    10-30-2011
    Location
    Doha
    MS-Off Ver
    MS office 365
    Posts
    701

    Re: VBA Help needed to create a document based on user input thru UserForm

    hi Abousetta,

    Please see the below list as advised.

    Textbox1 >> Sheets("Hazard Management Review Form").Range("Q2" & “N23”)
    Textbox2 >> Sheets("Hazard Management Review Form").Range("C2")
    ComboBox1 >> Sheets("Hazard Management Review Form").Range("I4")
    ComboBox2 >> Sheets("Hazard Management Review Form").Range("S4")
    ComboBox3 >> Sheets("Hazard Management Review Form").Range("S5")
    ListBox1 >> Sheets("Hazard Management Review Form").Range(“L11,L12,L13,L14,L15,L16,L17”),(”O11,O12,O13,O14,O15,O16,O17&O18”) & (”R11,R12,R13,R14,R15,R16,R17&R18”)
    Textbox3 >> Sheets("Hazard Management Review Form").Range("A23")
    Textbox4 >> Sheets("Hazard Management Review Form").Range("E23")
    Textbox5 >> Sheets("Hazard Management Review Form").Range("I23")
    ComboBox3 >> Sheets("Hazard Management Form").Range("A5")
    Textbox2 >> Sheets("Hazard Management Form").Range("B5") & (Management Review Form").Range("C5") = offset data of Master_Data sheet column “C”

    Thanks,
    Joshi
    Cheers,

    Joshi
    Being with a winner makes you a winner

  8. #8
    Forum Guru
    Join Date
    03-12-2010
    Location
    Canada
    MS-Off Ver
    2010 and 2013
    Posts
    4,418

    Re: VBA Help needed to create a document based on user input thru UserForm

    Hi,

    Here is what you need in the userform:

    Please Login or Register  to view this content.
    Now the last one (offset data of Master_Data sheet column “C”) I couldn't code because I don't know that means.

    Let me know if this works for you.

    abousetta
    Last edited by abousetta; 01-15-2013 at 02:44 PM.

  9. #9
    Forum Contributor
    Join Date
    10-30-2011
    Location
    Doha
    MS-Off Ver
    MS office 365
    Posts
    701

    Re: VBA Help needed to create a document based on user input thru UserForm

    Hi abousetta,

    Thanks for your code, but the values inserting wrong places. Can you please check and help me to fix the issue.

    Thanks,

  10. #10
    Forum Guru
    Join Date
    03-12-2010
    Location
    Canada
    MS-Off Ver
    2010 and 2013
    Posts
    4,418

    Re: VBA Help needed to create a document based on user input thru UserForm

    Hi,

    I noticed one mistake, but if the results are different than what you expect then let me know more specific details. If you notice, I just translated the ranges and sources of the values you presented in post #7. Maybe double-check these ranges/ sources.

    abousetta

+ 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