Posts by Mumps

    Try:

    The problem was caused by the merged cells containing the dates. You should avoid using merged cells because they almost always cause problems for macros. I have unmerged the cells. Try the attached file.

    Files

    • mithu.xlsm

      (21.47 kB, downloaded 38 times, last: )

    Try:

    Code for UserForm2

    Open the attached file. The macro below is in Module1. Change the workbook name in the code to suit your needs. Make sure that both files are open, select any cell in row 2 in the JWTESTLIST file and click the "Copy Data" button.

    You also have red cells in row 20. Do you want to check only column L for red cells? Could column L have more than one red cell? The file you posted doesn't include your userform. Please post a copy of your file which includes the userform and any macros you are currently using.

    We would need to know the paste location in the separate workbook for each cell in the row. It would be easer to help if you could attach a copy of your two files? It would be easier to see how your data is organized and to test possible solutions. Include a detailed explanation of what you want to do using a few examples from your data and referring to specific cells, rows, columns and sheets. De-sensitize the data if necessary.

    I tested the macro and it works properly. The macro first checks if a department exists in column F of sheet Planilha Completa. If a particular department does not exist, then then macro doesn't create a new workbook or email. I assumed that this is the way you want it to work. Did I assume correctly? Also, you have to make sure that the department names in column F of sheet Planilha Completa are exactly the same as those in column A of the Apoio sheet.

    Try:

    In the sample file you posted, the Planilha Completa sheet had no data so it was hard to test the macro. Can you post a copy of your file that has some data in that sheet to make testing easier?

    My apologies. Please use this revised version:

    Copy and paste this macro into the worksheet code module. Do the following: right click the tab name for your WORKFLOW sheet and click 'View Code'. Paste the macro into the empty code window that opens up. Close the code window to return to your sheet. First enter the data in B5 and B6 and then make a selection in B4. If you select TODOS OS DEPARTAMENTOS the emails for all departments will be created automatically. If you select only one department, the email for that department will be created automatically. You don't need any of the other macros and you don't need the Gerar FUP button.

    It would be easier to help and test possible solutions if you could attach a copy of your file. Explain in detail what you want to do referring to specific cells, rows, columns and sheets using a few examples from your data (de-sensitized if necessary).