VBA Code to put value of activeX textbox into a cell on another sheet

  • I'm really stumped on this one!


    I have an activeX control text box in my sheet in which the user will enter the evaluation date for the employee they chose from the slicer on the left. I want the user to be able to click the button below the textbox and have that date entered in the appropriate cell on the EVALS sheet.


    In order to find the correct cell for the date to be entered in, I've added some helper formulas below my button:


    Name = a UDF to enter the name of the employee selected from the slicer
    Semester = the semester chosen from the data validation drop down in cell B5
    Cell address = finds the cell address on the EVALS sheet of the name of the employee (which came from the UDF) in cell M17
    Number of Columns to Move Over = looks up the number of columns to move over from column G in Table18 on the DATA sheet


    Next I assigned the macro to my button with the following code which should, ideally, find the cell address of the employee chosen in the slicer and move the appropriate number of columns over from that cell address and enter the value of the date entered into the textbox, and then clear the slicer filter so the user can start over to enter the next evaluation date.



    Unfortunately, I can't get this to work.... I'm sure I'm missing something! If anyone can offer any help, I'd GREATLY appreciate it!!!


    Here's a version of my workbook with fictitious names of course! :)



    forum.ozgrid.com/index.php?attachment/68766/

  • Re: VBA Code to put value of activeX textbox into a cell on another sheet


    Ok I'm trying a different tactic...
    I've added a couple of helper cells/formulas to determine the NEW cell address that I want to use for the date I've typed into my textbox.
    [table="width: 500, class: grid"]

    [tr]


    [td][/td]


    [td]

    L

    [/td]


    [td]

    M

    [/td]


    [/tr]


    [tr]


    [td]

    17

    [/td]


    [td]

    Name

    [/td]


    [td]

    UDF to find name of employee selected from slicer

    [/td]


    [/tr]


    [tr]


    [td]

    18

    [/td]


    [td]

    Semester

    [/td]


    [td]

    Shows semester selected from a drop down (data validation list) in cell B5

    [/td]


    [/tr]


    [tr]


    [td]

    19

    [/td]


    [td]

    Cell Address

    [/td]


    [td]

    Formula looks up the cell address of the name in cell M17 (=ADDRESS(MATCH(M17,Table9[LFM Name],0)+ROW(Table9[[#Headers],[LFM Name]]),COLUMN(Table9[[#Headers],[LFM Name]]),4))

    [/td]


    [/tr]


    [tr]


    [td]

    20

    [/td]


    [td]

    Row #

    [/td]


    [td]

    Formula removes the column heading from the cell address in cell M19 so I'm left with the row # (=RIGHT(M19,LEN(M19)-1))

    [/td]


    [/tr]


    [tr]


    [td]

    21

    [/td]


    [td]

    Number of columns to move over

    [/td]


    [td]

    Looks up the semester in cell M18 and returns the # of columns to move over based on data in another table (=VLOOKUP(M18,Table18,2,FALSE))

    [/td]


    [/tr]


    [tr]


    [td]

    22

    [/td]


    [td]

    New Column

    [/td]


    [td]

    Looks up the # of columns to move over and returns what the NEW column should be based on data in another table (=VLOOKUP(M21,Table12,2,FALSE))

    [/td]


    [/tr]


    [tr]


    [td]

    23

    [/td]


    [td]

    New Cell Address

    [/td]


    [td]

    Takes the new column identified in cell M22 & adds the row # from cell M20 to give us the NEW cell address for the date in my textbox (=M22&M20)

    [/td]


    [/tr]


    [tr]


    [td]

    24

    [/td]


    [td][/td]


    [td]

    I wasn't sure if there would be an issue pointing to a cell address that was the value of a formula (cell M23), so I've amended my code to copy the cell address in M23 and paste the value into cell M24 so I can use that

    [/td]


    [/tr]


    [/table]
    So NOW, my code is:


    But it's STILL not working! I'm BEYOND stumped on this!

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!