updating worksheet with date and text from userform

  • Hi I am struggling with the code for a command button to update from a userform to my worksheet. I have just started using VBA and the internet is my source for learning.


    When I try and update the field on user form with text for example "N/A" I get run time error 13

    It will however update the worksheet cell with dates but I want the userform to update the worksheet with dates and text when necessary or just leave the cell empty .

    This is where I am at currently


    I would be grateful for any help on this

    Regards Bob

    Edited once, last by royUK: add code tags ().

  • Hi Bob:


    Please read the forum rules. You need to tag the code when you post.


    I am not sure i understand you fully.


    Try the following:




    otherwise post a sample workbook with expected result.



    Maqbool

  • Hi Bob, welcome to Ozgrid. Please note I have added code tags to your post, please read the Forum Rules to understand why.


    An example workbook would help solve this.

  • Thanks Maqbool I will tag the code next time


    I will attach a worksheet later to show better what I am trying to achieve.

    IsNumber caused an issue in the code you sent through.


    Thanks again:)

  • Hi Maqbool


    Hi I am trying to create a user sheet that updates the dates or the information in column E of the "Mandatory" Worksheet. It is fine for any cell containing an actual date, but if the cell is "blank" or contains "N/A" the update entry button within the Update Record button above will not allow me to enter the Text and I am trying to get around this so the userform will update both text & dates. Hope this explains it better I have attached a work in progress worksheet that should show my issue


    Regards Bob


    test.xlsm

Participate now!

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