Posts by Max1616

    Hello! try this code:


    You can change these variables per your specific needs:
    NameColumn = 1 'Change this if your names are not in column A
    FirstNameRow = 2 'Change this if your first name does not start in row 2 (1 would be the column header)
    NewColumn = 5 'Change this if you want to change the column of 10 names from column E to a different colulmn
    NumberOfNames = 10 '10 Names in new list


    Let me know if you have any questions.


    -Max

    Hello,


    Place this code in the userform module (to access the userform module, double click anywhere on the user form in visual basic editor):


    I also noticed that your userform has the combo box's row source set to the range Sheet2!A2:A100. You will need to delete this before the above code will work. To do that follow these steps:
    1. Go to the userform and pull up the properties window in visual basic editor.
    2. Click on the combo box and the properties window should change to reflect the combo box
    3. Within the properties window, scroll down to "RowSource" and delete the text in this field
    4. Save and exit visual basic editor.


    If you change your sheet names at any point in the future, you will need to update the text in the above code from "Sheets("Sheet2")" to "Sheets("NewSheetName")". This appears twice in the code I wrote for you.
    Let me know if you have any questions.

    I would do something like this:

    First you will need unlock the cells in the worksheet (re-lock any cells you would like to prevent people from editing):
    Select all cells in the worksheet (Cntrl + A) -> Right Click the Cells and click "Format Cells" -> Protection Tab -> Uncheck the "Locked" box.


    Then you can use this code. Anytime "Sanctioned" or "Rejected File" is selected in column F, and the user chooses yes on the input box, the entire row will be locked from editing:


    Please update the password in the code. It is currently "Password123"

    Can you paste the formula in cell P2 that you want copied down?


    Also, to confirm, if there is no data in column A you would like the same row in column P to be blank? And whenever someone enters something into a row in column A, that corresponding row in column P should be populated with the formula?

    Hello,


    Try this:


    Update the code where indicated, to do whatever you want when they select Yes/No

    Try this:


    Let me know if it works for you!

    Try this:

    Re: Subtract cell value based on textbox


    Hello! Create a command button for your user form (to run the code when clicked) and then paste in this code to the userform module:



    I hope this helps!


    -Max

    Re: vba to transpose rows headers and data to columns headers with respective data


    Hello! Give this a try:

    Re: VBA - ToggleButton Hide/Unhide Rows


    Try this:


    You can assign the code to a toggle button. (Let me know if you need help doing that). There are two macros here, one to hide all the rows that meet your criteria, and another to unhide all rows.


    Let me know how it works!

    Re: Delete Entire Rows from raw source Sheet that selected from ListBox and Auto Refr


    Hi Luzmen,


    This is because a listbox index starts at 0. So if you have a list that corresponded to rows 1-10. When the item in row 10 is selected, the list box index is 9 (full list index is 0-9).


    My guess is your index starts in row 2, so in this case row 2 = listbox.listindexindex 0


    Lets use a hypothetical:


    If your listbox contains values starting in row 2 to row 15 (2:15), your index for this list looks like this:
    0 = Row 2
    1 = Row 3
    2 = Row 4
    3 = Row 5
    etc.
    .
    .
    11 = Row 15


    So if you wanted to delete the row 10, you would need to set your list box to the row 10 value (Which in this case is index 8) then use Rows(ListBox.ListIndex + 2) since your index and row values are two digits off.


    I hope this makes sense and answers your question!


    Sincerely,
    Max

    Re: VBA - if cell value true, offset, check value then delete if criteria met


    Try this:



    If this is wrong, can you send me a list before and after the macro is ran?