Delete selected range in listbox and the corresponding Range in worksheet and shift cells up

  • Just added a set of dummy data in Columns C and D ... and your ' special ' Remove Item macro is still working fine ... :)

    If you feel like saying "Thank You" for the help received, do not hesitate to click the "Thumbs Up" icon, below, in the bottom right corner:)

  • Why F17 ... ???


    Since you said earlier :


    1. Range should be limited : going from Row 4 to Row 14


    2. Your ' twin columns " are Column B and Column E

    If you feel like saying "Thank You" for the help received, do not hesitate to click the "Thumbs Up" icon, below, in the bottom right corner:)

  • and also column heads is set .....true


    This does not have any impact ...


    By the way ... just noticed you are using Merged Cells ...for Total, Change and Cash ...


    NEVER ...NEVER ... use Merged Cells ...:thumbdown::cursing: ... since they can only generate HUGE Problems ...!!!:evil:


    It is not very difficult ...if cosmetics is the main issue ... to set your Row Height at 29 ...

    If you feel like saying "Thank You" for the help received, do not hesitate to click the "Thumbs Up" icon, below, in the bottom right corner:)

  • your question....."Why F17 ... ???"

    as i want the list box to display the "TOTAL AMOUNT" of the transaction ....and this range is in Cell "F17"


    If you need to display this amount ... you can have a dedicated TextBox to display it ... :)

    If you feel like saying "Thank You" for the help received, do not hesitate to click the "Thumbs Up" icon, below, in the bottom right corner:)

  • I am sorry about that.....I am totally new to this whole set of programming.....I started with a simple excel sheet for my business use and slowly the whole thing grew so big....now there are little chances of modifying anything....so I am just trying to accommodate what ever is possible... maybe in future when i am well versed with vba i'll develop the whole thing from scratch and systematically .....

    for time being if you can adjust this code to my requirement....ill be greatfull

  • Back to my message # 20 ...


    Quote

    Regarding the problems you are facing for the transposition in your real-life workbook ...


    The best thing to do would be to attach a second sample file much closer to the reality than the one you have posted ...;)

    If you feel like saying "Thank You" for the help received, do not hesitate to click the "Thumbs Up" icon, below, in the bottom right corner:)

  • I think the sample workbook i posted is the closest possible to real-like workbook.......

    Only differences are the ranges.....which i think I had mentioned in the sample workbook

  • Hi Carim......not working in my workbook

    Same problem...code stops at this line

    Code
    If ListBox1.ListIndex >= 0 Then
            ListBox1.RemoveItem ListBox1.ListIndex

    I think.......you are being troubled unnecessarily.......Your codes in the sample worksheet works just great....

    Problem is at my end......

    Maybe i'll drop this idea, what say ?

  • Whenever you are " transposing " ... bear in mind the following three elements are inseparable :


    1. The UserForm itself

    2. The UserForm_Initialize event code

    3. The CommandButton2_Click event code


    Good Luck

    :)

    If you feel like saying "Thank You" for the help received, do not hesitate to click the "Thumbs Up" icon, below, in the bottom right corner:)

Participate now!

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