Posts by jaeda1920

    Re: Clear contents of a hidden worksheet upon closing


    I tried specifying a range and it gives me a compile error Expected: list separator or ) when I typed the following:
    If WorksheetFunction.CountBlank(A2:A3) = 1 Then


    I tried different values but not sure what's causing it to bug out.
    Disclaimer. I am not an expert in vba, very much a beginner/intermediate. I have done a lot of research on threads and vba tutorials to produce the code used

    Quote from royUK;792364

    You don't specify a range to check for CountBlank

    So I had this working but for some reason I updated the code and it does not compile. I have provided the code and what I am trying to accomplish in the comments as well
    I am trying to do an if statement that will check a hidden worksheet via the userform
    if contents are in the sheet, they will be removed before the form is closed
    if contents are not found then there will be nothing to clear and they will see a different series of message boxes before closing


    The if statement below does not properly search the worksheet "userfeedbackata" to see if it's empty and the clear data sub command also does not seem to be working but was working previously even though I have not changed the code in that specific command, only in the closecommand_click() function


    Re: Attach single worksheet (not workbook) from excel userform to outlook


    Thank you and that is the goal. However the file created is not attaching in the email. I' still trying to figure out why.


    Re: Attach single worksheet (not workbook) from excel userform to outlook


    Ok so a few things are happening from the code provided


    1) I changed the code from .send to .display because i want the user to be able to add in information or attachements as needed however prior to changing to .display, the email would go through but it would also bug out at the Kill sFileName line.


    2) While I can see it creating the file, it is not attaching the file to the email but it does save the correct sheet and its data.


    Any suggestions because this is the farthest this has come to actually working properly. Thank you.


    Quote from KjBox;791710

    Try this

    Re: Attach single worksheet (not workbook) from excel userform to outlook


    I think that it errors out because users will not have permissions to save to the desktop unless its under their user profile.


    I will keep researching but will try to incorporate the code as well.

    Quote from Logit;791707

    .
    .
    Edit this portion of the macro code to this :


    I am not well versed in vba but have understood enough to create a user feedback form.


    What I am trying to do is email a single worksheet (which is the the first sheet because that is used to collect the data, the second sheet which is what I want to attach is where the data is stored.


    I have been doing research online and the only two solutions I can find is either email the active sheet or email the entire workbook. I feel the code I have is close to what I want to accomplish but I want it to send sheet 2 as the attachment and not sheet 1.


    Any assistance is greatly appreciated.

    Re: Forcing the cell input to only text


    Where does this code go to validate on a text field in a userform?