+ Reply to Thread
Results 1 to 15 of 15

Insert New Employee

Hybrid View

  1. #1
    Forum Contributor
    Join Date
    06-21-2013
    Location
    Chicago, IL
    MS-Off Ver
    Excel 2010
    Posts
    186

    Re: Insert New Employee

    Mumps!,

    I am trying to learn as I go...
    Can you provide a quick explanation of what the (- 2) and (-3) are doing in this code?

     Rows(Findrow.Row - 2).Insert
        Range("A" & Findrow.Row - 3) = sNumber
    Also, If I enter Abe Abraham as a new employee, his row is inserted after Greg Clem.

  2. #2
    Forum Expert Mumps1's Avatar
    Join Date
    10-10-2012
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2010, 365
    Posts
    8,026

    Re: Insert New Employee

    Try the attached file. I have fixed the alphabetizing problem. "Findrow.row" is a variable that represents the row number of the cell containing "Total Hours". The (- 2) and (-3) subtract 2 and 3 respectively from the row number containing "Total Hours". For example, if Findrow.row=20 then subtracting 3 will change its value to 17 which is the value I need because it refers to the row number of the last name in column B. I hope this makes sense.
    Attached Files Attached Files
    You can say "THANK YOU" for help received by clicking the Star symbol at the bottom left of the helper's post.
    Practice makes perfect. I'm very far from perfect so I'm still practising.

+ 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. userfrom consist of 3 list box to insert attendance for employee
    By mazan2010 in forum Excel Programming / VBA / Macros
    Replies: 16
    Last Post: 07-20-2017, 05:08 AM
  2. convert multiple employee records to one record per employee
    By jmccullough in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 07-27-2016, 10:39 AM
  3. Insert Picture In Cell By Matching Employee ID
    By NeedForExcel in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 09-03-2015, 03:23 AM
  4. Generate output employee data from input employee sheet
    By welchs101 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-29-2015, 05:28 PM
  5. Excel Automatically Insert Employee Number
    By ryanb4614 in forum Excel General
    Replies: 3
    Last Post: 09-06-2013, 09:15 AM
  6. insert missing date per employee
    By uidards in forum Excel General
    Replies: 2
    Last Post: 05-24-2013, 03:27 AM
  7. Insert Pay Rate Based On Employee Selected
    By Spencer in forum Excel General
    Replies: 5
    Last Post: 02-06-2009, 03:58 PM

Tags for this Thread

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