Column Width With Userform

  • With the code in the topic below, it automatically expands the cells I enter data into the table manually.

    but how can I do this when entering data with "useform"?


  • Hello,


    A very very small modification for your UserForm ... ;)


    Code
    ' Adjust Column Width
      .Columns("A:C").Columns.AutoFit
  • Hello,


    A very very small modification for your UserForm ... ;)


    Code
    ' Adjust Column Width
      .Columns("A:C").Columns.AutoFit

    Thank you teacher

    health to your hands

    I have a question,

    it doesn't shrink when i delete data and unfortunately it doesn't expand when i log in manually.

  • When you say:


    it doesn't shrink when i delete data and unfortunately it doesn't expand when i log in manually.


    Just manually re-type the last data in the last row in Column C ;)

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

  • When you say:


    it doesn't shrink when i delete data and unfortunately it doesn't expand when i log in manually.


    Just manually re-type the last data in the last row in Column C ;)

    I didn't notice that detail :)

    thanks

    Sir, I think the working principle is as follows

    "enter data manually"

    I fill columns a-b-c and it expands automatically.

    To collapse it, it is necessary to delete column a-b-c "in order".

    "with user form"

    It expands automatically when I enter data.

    but when I delete the data the width stays the same.

  • You are welcome :)

    If you feel like saying "Thank You" for the help received, do not hesitate to click the "Smiley" 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!