+ Reply to Thread
Results 1 to 8 of 8

Enter User Input Data into Next Free Cell based on Column Name

  1. #1
    Registered User
    Join Date
    04-08-2015
    Location
    America
    MS-Off Ver
    Office 2013
    Posts
    29

    Enter User Input Data into Next Free Cell based on Column Name

    Hi everyone,
    I am trying to create a user friendly macro for entering new meeting information based on the contacts name.
    For example i have a sheet (attached), and i want to be able to click a button and then the user inputs a name, and also inputs a meeting note.

    Name: John <- user input
    New Meeting Note: JD 1/1/11 <- user input

    I hoped to create a macro to search for the name input in column A and then input the "New Meeting Note" in the next available cell.
    I was thinking it could find the column titled "Meetings" then search for the next blank cell to the right of it as there could already be data in the Meeting column, and possible a number of columns to the right as well.

    See the attached for a visual

    Cheers for any help.
    Attached Files Attached Files
    Last edited by nKife; 04-21-2015 at 08:46 PM.

  2. #2
    Forum Expert
    Join Date
    01-23-2013
    Location
    USA
    MS-Off Ver
    Microsoft 365 aka Office 365
    Posts
    3,863

    Re: Enter User Input Data into Next Free Cell based on Column Name

    Hi nKife and welcome to ExcelForum,

    See the attached file (based on your original file) which uses a UserForm to select an existing name, and entry and posting of a Meeting Note.

    There are 3 modules that contain code:
    Sheet1 module:
    Please Login or Register  to view this content.
    UserForm1 module:
    Please Login or Register  to view this content.
    Ordinary Code Module (ModUserForm1):
    Please Login or Register  to view this content.
    ---------------------
    The following may help access the code and learn what is going on:

    To access a Module in VBA:
    a. 'Left Click' on any cell in the Excel Spreadsheet.
    b. ALT-F11 to get to VBA.
    c. CTRL-R to get project explorer (if it isn't already showing).
    d. 'Double Click' on the module you want to access in the 'Project Explorer'.
    e. Insert code into the module if needed. 'Option Explicit' should only appear ONCE at the top of the module.

    NOTE: To access UserForm code, 'Right Click' on the UserForm module, then select 'View Code'. To access the UserForm itself, 'Double Click' on the UserForm module.

    Debugger Secrets:
    a. Press 'F8' to single step (goes into subroutines and functions).
    b. Press SHIFT 'F8' to single step OVER subroutines and functions.
    c. Press CTRL 'F8' to stop at the line where the cursor is.
    d. 'Left Click' the margin to the left of a line to set (or clear) a BREAKPOINT.
    e. Press CTRL 'G' to open the IMMEDIATE WINDOW. 'debug.print' statements send their
    output to the IMMEDIATE WINDOW.
    f. Select View > Locals to see all variables while debugging.
    g. To automatically set a BREAKPOINT at a certain location put in the line:
    'Debug.Assert False'
    h. To conditionally set a BREAKPOINT at a certain location put in lines similar to:
    if i >= 20 and xTV20 > 99.56 then
    Debug.Assert False
    endif
    i. A variable value will be displayed by putting the cursor over the variable name.
    ---------------------

    Please let me know if you have any problems or questions.

    Lewis
    Attached Files Attached Files
    Last edited by LJMetzger; 04-21-2015 at 08:11 PM.

  3. #3
    Registered User
    Join Date
    04-08-2015
    Location
    America
    MS-Off Ver
    Office 2013
    Posts
    29

    Re: Enter User Input Data into Next Free Cell based on Column Name

    Works great thanks so much. Now to apply this to a larger spreadsheet!

  4. #4
    Registered User
    Join Date
    04-08-2015
    Location
    America
    MS-Off Ver
    Office 2013
    Posts
    29

    Re: Enter User Input Data into Next Free Cell based on Column Name

    The only issue I am having is that if the data is moved down some rows, i.e. row A and B are blank the code does not work. Is there a way around this. For example I may want a heading or some logos in the first 2, 3 or 4 rows, then the data below it.
    Cheers

  5. #5
    Forum Expert
    Join Date
    01-23-2013
    Location
    USA
    MS-Off Ver
    Microsoft 365 aka Office 365
    Posts
    3,863

    Re: Enter User Input Data into Next Free Cell based on Column Name

    The only issue I am having is that if the data is moved down some rows, i.e. row A and B are blank the code does not work. Is there a way around this. For example I may want a heading or some logos in the first 2, 3 or 4 rows, then the data below it.
    Thanks for the rep points.

    See the line in the UserForm1 module above in post #2 that I just changed to red:
    Please Login or Register  to view this content.
    The value of iRow is set to 1 because the first name is in Row2. If the first name is in row 6, set the value of iRow to 5.

    Lewis

  6. #6
    Registered User
    Join Date
    04-08-2015
    Location
    America
    MS-Off Ver
    Office 2013
    Posts
    29

    Re: Enter User Input Data into Next Free Cell based on Column Name

    In section 3 "Ordinary Code Module"
    I receive an error;

    2015-04-22 10_29_46-Microsoft Visual Basic.png

    Please Login or Register  to view this content.
    I am unsure what would cause this error.

    Cheers

  7. #7
    Forum Expert
    Join Date
    01-23-2013
    Location
    USA
    MS-Off Ver
    Microsoft 365 aka Office 365
    Posts
    3,863

    Re: Enter User Input Data into Next Free Cell based on Column Name

    I am not able to duplicate your error. To receive further help, you will have to upload a sample workbook that demonstrates the error. Please include detailed instructions on what to do to make the error appear.

    Lewis

  8. #8
    Registered User
    Join Date
    04-08-2015
    Location
    America
    MS-Off Ver
    Office 2013
    Posts
    29

    Re: Enter User Input Data into Next Free Cell based on Column Name

    Never mind mate I fixed it.
    Appreciate all your help you are a fantastic person +1 rep!

+ 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] Create User Input Dialog Box to Enter Keywords for Word Search in a Cell
    By vcs1161 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-06-2013, 01:36 PM
  2. Using text box input to lookup number and replace based on user input into new column
    By harl3y412 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-28-2011, 03:15 PM
  3. Replies: 1
    Last Post: 08-27-2010, 02:59 AM
  4. Enter Text Into Cells Based on User Input
    By jdmay in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-23-2010, 11:50 AM
  5. Copy cell data from workbook based on user input
    By Michael A in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 12-31-2005, 11:10 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