+ Reply to Thread
Results 1 to 9 of 9

Help! Userform VBA to find data in cell and insert into 2 cells over to right.

  1. #1
    Registered User
    Join Date
    06-16-2015
    Location
    Cincinnati
    MS-Off Ver
    2013
    Posts
    36

    Help! Userform VBA to find data in cell and insert into 2 cells over to right.

    Hello all,

    I have a userform that has 1 txt bx. The process of the userform is for a person to insert a device # then click on command button. I need vba code to have that userform search and find the last row that contains that device # and insert the same device# 2 cells to the right. THe purpose of this is a "check out / check in" program. I have the "check out" part done which is a seperate userform but struggling with the "check in" userform to perform this task.

    The "check out" column will contain the device # then next column to the right will auto timestamp then the next column will contain the "check in" device # (which is the same) and the column right of that will have a timestamp.

    So both columns with have the same device # but will show timestamp when it was checked out and then different timestamp when checked back in. This is all contained in same row.

    Any question let me know. I can send you the work book if needed.

    Thanks for your help on this,

    MG
    Attached Files Attached Files
    Last edited by MG3; 06-17-2015 at 12:52 PM.

  2. #2
    Forum Contributor
    Join Date
    07-11-2012
    Location
    india
    MS-Off Ver
    Excel 2010
    Posts
    144

    Re: Help! Userform VBA to find data in cell and insert into 2 cells over to right.

    Hi MG3,

    Better to attach your Sheet so that everyone can understand. and code based on your needs.
    Ravikumar,

    * Please Add Reputation if solved.

  3. #3
    Registered User
    Join Date
    06-16-2015
    Location
    Cincinnati
    MS-Off Ver
    2013
    Posts
    36

    Re: Help! Userform VBA to find data in cell and insert into 2 cells over to right.

    I attatched the workbook

    Thanks

  4. #4
    Forum Expert
    Join Date
    09-20-2011
    Location
    England
    MS-Off Ver
    Excel 2010
    Posts
    2,278

    Re: Help! Userform VBA to find data in cell and insert into 2 cells over to right.

    Hello
    I'm not great with VBA but after a little messing around, maybe this code on your 'CheckInHandheld' user form 'Enter' command button:

    Please Login or Register  to view this content.
    Hope this helps.
    *Note I should really have put some comments in the code but it's getting late here and my Brain Hurts!
    DBY
    Last edited by DBY; 06-18-2015 at 08:55 AM. Reason: Highlighted code

  5. #5
    Registered User
    Join Date
    06-16-2015
    Location
    Cincinnati
    MS-Off Ver
    2013
    Posts
    36

    Re: Help! Userform VBA to find data in cell and insert into 2 cells over to right.

    This works great! But When I inter the Device # and click on the command button it works just like it should but it also takes me to the sheet where it send the data. All of my other userforms just stay on the home sheet when I click on their command button. Is there any code I can take out to prevent this from happening?

    MG

  6. #6
    Forum Expert
    Join Date
    09-20-2011
    Location
    England
    MS-Off Ver
    Excel 2010
    Posts
    2,278
    Yes, the bottom two lines before the End Sub (in red).
    Last edited by DBY; 06-18-2015 at 08:56 AM.

  7. #7
    Registered User
    Join Date
    06-16-2015
    Location
    Cincinnati
    MS-Off Ver
    2013
    Posts
    36

    Re: Help! Userform VBA to find data in cell and insert into 2 cells over to right.

    Hello DBY,

    I have decided to add another txt bx to this what would be the code. Nothing special but just to add data in same row column 9

  8. #8
    Forum Expert
    Join Date
    09-20-2011
    Location
    England
    MS-Off Ver
    Excel 2010
    Posts
    2,278

    Re: Help! Userform VBA to find data in cell and insert into 2 cells over to right.

    Hi
    Only just noticed that you've posted another question. If for instance the text box was named 'txtNew', then just add the code to the bottom of the existing code above assuming you've removed the two lines in red:

    Please Login or Register  to view this content.
    or using Offset as above:
    Please Login or Register  to view this content.
    or if you want to reference using numbers:
    Please Login or Register  to view this content.

  9. #9
    Registered User
    Join Date
    06-16-2015
    Location
    Cincinnati
    MS-Off Ver
    2013
    Posts
    36

    Re: Help! Userform VBA to find data in cell and insert into 2 cells over to right.

    Thanks again. Some day I will be smart like you guys!

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] Userform to find data in cell of last row and insert in next cell over
    By MG3 in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 06-17-2015, 05:57 PM
  2. Find next used cell and then insert cells relative to that cell
    By ratdogexcel in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-14-2013, 11:23 PM
  3. [SOLVED] Find empty cells in a range and insert formula in adjacent cell
    By macronovice1 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 10-25-2012, 03:06 PM
  4. Replies: 0
    Last Post: 10-04-2012, 08:21 PM
  5. [SOLVED] Userform code for .find function to adjust cell data
    By creekybones in forum Excel Programming / VBA / Macros
    Replies: 14
    Last Post: 09-20-2012, 04:55 AM

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