+ Reply to Thread
Results 1 to 5 of 5

VBA Code to extract data from userform

  1. #1
    Registered User
    Join Date
    08-01-2013
    Location
    DallasTX
    MS-Off Ver
    Excel 2007
    Posts
    40

    VBA Code to extract data from userform

    Hello,

    I am working on a userform and I am using this code to extract the data. I've named each section on the form and then I want the information to go into the next empty row when I hit submit. It was working at one point and now it is not. It bugs at the first Cell(erow,2)=.... and says I need an object? Please help...

    ActiveWorkbook.Sheets("Reqs").Activate

    Erow = Sheets("Reqs").Cells(Rows.Count, 1).End(xlUp).Offset(1, 0).Row

    Cells(Erow, 2) = REQ_TXTBX_REQNUM.Text
    Cells(Erow, 5) = REQ_LISTBX_DATERCD_M.Text
    Cells(Erow, 6) = REQ_LISTBXDATERCD_D.Text
    Cells(Erow, 3) = REQ_LIST_POD.Text
    Cells(Erow, 4) = REQ_LIST_RECRUITER.Text
    Cells(Erow, 11) = REQ_LIST_JOBTITLE.Text
    Cells(Erow, 12) = REQ_TXTBX_CITY.Text
    Cells(Erow, 13) = REQ_LIST_STATE.Text
    Cells(Erow, 14) = REQ_LIST_HIRINGMANAGER.Text
    Cells(Erow, 15) = REQ_LIST_DEPT.Text
    Cells(Erow, 16) = REQ_LIST_BUNIT.Text
    Cells(Erow, 17) = REQ_LIST_SBAND.Text
    Cells(Erow, 18) = REQ_LIST_SALGRD.Text
    Cells(Erow, 19) = REQ_LIST_CAT.Text

  2. #2
    Forum Expert mikerickson's Avatar
    Join Date
    03-30-2007
    Location
    Davis CA
    MS-Off Ver
    Excel 2011
    Posts
    6,229

    Re: VBA Code to extract data from userform

    Where is that code? In the userform's code module or somewhere else?
    _
    ...How to Cross-post politely...
    ..Wrap code by selecting the code and clicking the # or read this. Thank you.

  3. #3
    Registered User
    Join Date
    08-01-2013
    Location
    DallasTX
    MS-Off Ver
    Excel 2007
    Posts
    40

    Re: VBA Code to extract data from userform

    It is in the userform module when I doubleclick the "submit' button I created a private sub comes up.

    I got it to work somehow, but now it won't skip to the next row.
    I can type 12345 for the req number and submit and it will go to the right row..
    but then I try to type 45678 and it replaces the 12345. I don't want it to do that. I want it to go to the next line after 12345

  4. #4
    Forum Expert mikerickson's Avatar
    Join Date
    03-30-2007
    Location
    Davis CA
    MS-Off Ver
    Excel 2011
    Posts
    6,229

    Re: VBA Code to extract data from userform


    Type 45678 in where? If you could attach a sample workbook, it would be easier to help.

    Are you and the guy who posted
    http://www.excelforum.com/excel-prog...worksheet.html

    in the same class? Your problems sound very similar.

  5. #5
    Registered User
    Join Date
    08-01-2013
    Location
    DallasTX
    MS-Off Ver
    Excel 2007
    Posts
    40

    Re: VBA Code to extract data from userform

    No we probably watched the same Youtube video.

    I created a form to enter new requisitions (for recruiting team)
    I created a text box and a submit button. Each time I click "submit" I want it to create a new record with the number I put in the textbox. I got it to work, but it won't offset to the next row.

    Here's the youtube video:
    http://www.youtube.com/watch?v=KhwkG...=TLHvAfwdagKJs

+ 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. Need help with modifying the VBA code Extract data
    By honeybunny in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-15-2013, 09:10 PM
  2. [SOLVED] VBA code to extract data from Wikipedia
    By Kiran Kurapati in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 06-28-2013, 05:17 AM
  3. VBA code to extract specific data
    By andy.k in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 03-23-2013, 02:25 PM
  4. Using VBA code to extract web data
    By AnthonyWB in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 01-07-2013, 08:00 AM
  5. VBA Code to extract data to csv file.
    By ssdsibes in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 05-18-2011, 10:45 PM

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