+ Reply to Thread
Results 1 to 13 of 13

Require vba code for user form

  1. #1
    Forum Contributor satputenandkumar0's Avatar
    Join Date
    11-08-2012
    Location
    Pune, India
    MS-Off Ver
    Office xp & Office 2007
    Posts
    398

    Question Require vba code for user form

    Hi Forum,

    I am downloading the data from our company's web. And I have to check the THC details (Truck Hire Chalan ) Truck Hire, Advance and Balance with the hard copy. I have created userform where if I enter THC No. vba code have to seach this in the downloaded data in data sheet and should display Truck Hire, Adcance and Balance . (pls find attached file.)

    eg. If I enter 1620120 it should search in "B" coloumn it is in cell b2 in Data sheet, and display

    Truck Hire = M2,
    Advance = p2,
    Balance = q2

    Below is the code I have recorded

    Please Login or Register  to view this content.
    Regards,
    Nandkumar S.
    Attached Files Attached Files

  2. #2
    Valued Forum Contributor Naveed Raza's Avatar
    Join Date
    11-04-2012
    Location
    India, Hyderabad
    MS-Off Ver
    Excel, Access 2007/2010
    Posts
    1,338

    Re: Require vba code for user form

    Hi Nandkumar,

    that THC nbr will be always unique nbr or any duplicate nbrs will come

  3. #3
    Forum Contributor
    Join Date
    10-01-2012
    Location
    england
    MS-Off Ver
    Excel 2016 pro
    Posts
    772

    Re: Require vba code for user form

    hi
    have you thought about combobox and vlookup
    you can modify this to suit just change userform labels and add more textboxes
    colin
    Attached Files Attached Files
    Last edited by cfinch100; 06-22-2013 at 05:55 AM.

  4. #4
    Forum Contributor satputenandkumar0's Avatar
    Join Date
    11-08-2012
    Location
    Pune, India
    MS-Off Ver
    Office xp & Office 2007
    Posts
    398

    Re: Require vba code for user form

    Thanks for replying Naveed Raza and cfinch100,

    I have made user form to check the THC details only. I don't want any input.

    Naveed Raza, that THC nbr will be always unique nbr

    Regards,
    Nandkumar S.

  5. #5
    Forum Guru HaHoBe's Avatar
    Join Date
    02-19-2005
    Location
    Hamburg, Germany
    MS-Off Ver
    work: 2016 on Win10 (notebook), private: 2019 on Win10 (desktop), 2019 on Win11 (notebook)
    Posts
    8,197

    Re: Require vba code for user form

    Hi, satputenandkumar0,

    only code behind the Userform:
    Please Login or Register  to view this content.
    You should consider 2 more buttons: one for Cancel and one for clearing the textboxes.

    Ciao,
    Holger
    Use Code-Tags for showing your code: [code] Your Code here [/code]
    Please mark your question Solved if there has been offered a solution that works fine for you

  6. #6
    Valued Forum Contributor Naveed Raza's Avatar
    Join Date
    11-04-2012
    Location
    India, Hyderabad
    MS-Off Ver
    Excel, Access 2007/2010
    Posts
    1,338

    Re: Require vba code for user form

    glad here this , self practice is best practice good.

  7. #7
    Forum Contributor
    Join Date
    10-01-2012
    Location
    england
    MS-Off Ver
    Excel 2016 pro
    Posts
    772

    Re: Require vba code for user form

    hi
    the vlookup only looks at sheet, does not allow editing ,you could lock textbox properties if you wish,just use combobox to enter thc number
    colin

  8. #8
    Forum Contributor satputenandkumar0's Avatar
    Join Date
    11-08-2012
    Location
    Pune, India
    MS-Off Ver
    Office xp & Office 2007
    Posts
    398

    Re: Require vba code for user form

    thanks HaHoBe,

    It is working very perfectly.

    Regards,
    Nandkumar S.

  9. #9
    Forum Contributor satputenandkumar0's Avatar
    Join Date
    11-08-2012
    Location
    Pune, India
    MS-Off Ver
    Office xp & Office 2007
    Posts
    398

    Re: Require vba code for user form

    Dear HaHoBe,

    The earlier coding given by you work perfectly, Now can you help by giving a coding wherein a date value is inserted against the THC number which has been found in the data on the date when it is checked , so that the same THC number details can be moved to another sheet once the data gets accumulated too much.

    Regards,
    Nandkumar S.
    Last edited by satputenandkumar0; 06-22-2013 at 06:47 AM. Reason: add details

  10. #10
    Forum Guru HaHoBe's Avatar
    Join Date
    02-19-2005
    Location
    Hamburg, Germany
    MS-Off Ver
    work: 2016 on Win10 (notebook), private: 2019 on Win10 (desktop), 2019 on Win11 (notebook)
    Posts
    8,197

    Re: Require vba code for user form

    Hi, satputenandkumar0,

    Iīm not sure to understand your request: find the values for a THC number, alter them and write the changed values back to teh sheet? What about entering a new THC number and writing back?

    Code for reading THC number in anbd writing back to same row after change:
    Please Login or Register  to view this content.
    Ciao,
    Holger

  11. #11
    Forum Contributor satputenandkumar0's Avatar
    Join Date
    11-08-2012
    Location
    Pune, India
    MS-Off Ver
    Office xp & Office 2007
    Posts
    398

    Re: Require vba code for user form

    sir,

    We do not want to change anything in the data except that once the THC is found while checking we need to mark (system date can be inserted against the checked THC no. in column "R") that THC number, so that the same can be deleted from the sheet.

    Regards,
    Nandkumar S.

  12. #12
    Forum Guru HaHoBe's Avatar
    Join Date
    02-19-2005
    Location
    Hamburg, Germany
    MS-Off Ver
    work: 2016 on Win10 (notebook), private: 2019 on Win10 (desktop), 2019 on Win11 (notebook)
    Posts
    8,197

    Re: Require vba code for user form

    Hi, satputenandkumar0,

    sorry but I got it all wrong.

    Please Login or Register  to view this content.
    You may adapt Column S to your needs but thatīs the first empty following the data on Sheet "data".

    Ciao,
    Holger

  13. #13
    Forum Contributor satputenandkumar0's Avatar
    Join Date
    11-08-2012
    Location
    Pune, India
    MS-Off Ver
    Office xp & Office 2007
    Posts
    398

    Re: Require vba code for user form

    Sir,

    It works perfect after merged with code in post #5.

    very thanks for your guidance,

    Regards,
    Nandkumar S.

+ 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