+ Reply to Thread
Results 1 to 8 of 8

Copy data from Userform back to excelsheet

  1. #1
    Forum Contributor
    Join Date
    02-20-2009
    Location
    bristol
    MS-Off Ver
    Excel 2003
    Posts
    882

    Copy data from Userform back to excelsheet

    Hi guys

    Please find attached the spreadsheet. When a user enter the start time ,finish time and Value and then press enter then in the sheet the value should display from start time to finish time.

    If start time is 05:00 and finish time is 08:00 then the value should be inserted under the columns 05:30 to 08:00.

    Thanks
    Attached Files Attached Files

  2. #2
    Forum Expert snb's Avatar
    Join Date
    05-09-2010
    Location
    VBA
    MS-Off Ver
    Redhat
    Posts
    5,649

    Re: Copy data from Userform back to excelsheet

    You can use DTPicker controls. See the attachment.
    Attached Files Attached Files



  3. #3
    Forum Contributor
    Join Date
    02-20-2009
    Location
    bristol
    MS-Off Ver
    Excel 2003
    Posts
    882

    Re: Copy data from Userform back to excelsheet

    Hi snb

    Sorry I think I didn't make you understand my problem.

    I just want the code to populate the value in excelsheet when the user enters the start time and finish time and press enter button.

    Please see the userform in the attached workbook.

    If the user types in Start time=08:00, Finish time= 16:00 , Value=20. Then the value 20 should be appeared from 08:00 to 16:00 in the columns.


    Thanks

  4. #4
    Forum Expert snb's Avatar
    Join Date
    05-09-2010
    Location
    VBA
    MS-Off Ver
    Redhat
    Posts
    5,649

    Re: Copy data from Userform back to excelsheet

    My suggestion is not to use a userform.

  5. #5
    Valued Forum Contributor mohd9876's Avatar
    Join Date
    05-04-2011
    Location
    Amman, Jordan
    MS-Off Ver
    Excel 2010
    Posts
    426

    Re: Copy data from Userform back to excelsheet

    Dear Aman,

    First of all you need to do some modifications on your your sheet:
    I suggest you pick the number format of your first row as time.
    I also suggest you change the text boxes to a Date Time Picker to avoid wrong input values.

    for testing please see the modified workbook attached.
    I think you would want to modify the code to handle errors.

    Mohammad
    Attached Files Attached Files

  6. #6
    Forum Contributor
    Join Date
    02-20-2009
    Location
    bristol
    MS-Off Ver
    Excel 2003
    Posts
    882

    Re: Copy data from Userform back to excelsheet

    I have to use userform as I have just sent you the test copy but in actual my project is big and my client wants a userform to input everything before it gets copied to excelsheet.

    I think we can do one thing. like
    a=start time
    b=finish time
    c=finish time-start time
    then run the loop from 1 to c and input the value in the columns. But the only problem is how to find the starting point to input those values.

    e.g if start time=07:00
    finish time= 12:00

    then c=05:00

    we have to run the loop 5 times but we have to start inputting the value from column 07:00 till 12:00.
    I hope you can figure out my problem.

    Thanks

  7. #7
    Forum Contributor
    Join Date
    02-20-2009
    Location
    bristol
    MS-Off Ver
    Excel 2003
    Posts
    882

    Re: Copy data from Userform back to excelsheet

    The heading that appears in the test workbook is in the first row but in actual its not always in the same position. In actual project its in the middle and again the position of the row heading changes every time.

    Please see the staff requirement spreadsheet as attached.

    Thanks
    Attached Files Attached Files

  8. #8
    Forum Contributor
    Join Date
    02-20-2009
    Location
    bristol
    MS-Off Ver
    Excel 2003
    Posts
    882

    Re: Copy data from Userform back to excelsheet

    Can anyone please figure out my problem?

    Thanks

+ 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