Posts by papillion007

    Hi. I have this code which works almost fine:



    1. New data entry via "TextBox1" to a range named "glist".
    2. Sort items A-Z in extended "glist"
    3. Populate "ComboBox1"


    Error on 2nd and 3rd : Sorting items and populating combobox from one step behind. First data entry isnt sorted until I enter second data.


    Thanks in advance.


    Re: optimize vba code


    Hi again. I solved the problem by these people's book: John Green, Stephen Bullen, Rob Bovey, Michael Alexander (Excel 2007 VBA Programmer's Reference)


    The trick for class module which Krishnakumar mentioned is:


    Code
    Public WithEvents ButtonName As MSForms.CommandButton
    Private Sub ButtonName_Click()
    Dim sButtonC, sComboboxN As String
    sButtonC = ButtonName.Caption
    sComboboxN = "cbx" & sButtonC
    With UserForm1.Controls(sComboBoxN)
    .Enabled = True
    End With
    End Sub




    Thanks for your answers.

    Re: optimize vba code


    Quote from Krishnakumar;770250

    Probably a Class Module would help you.


    Thanks but there are a lot examples like that. They perform only Btn_click part. İ tried to combine buttons with labels but i couldnt.

    Re: optimize vba code


    Thanks for answering. I think your way is true. But real issue is I have button for each label. Loop must be triggered by assigned button. Please help.

    Hi. I have a userform to update some excel data. I have plenty codes like this. Is there anyway to optimize following code? Thanks in advance.



    Re: select method of sheet class failed


    When I was preparing a sample for you, I saw the problem and somehow fixed. Here is another problem now:



    This macro aims to concatenate 4 cells and make 2 of them bold. But when there is repeating words it fails. For example;


    AJ10: more
    AJ11: and
    AJ12: and
    AJ13: strength


    A11: more and and strength


    But my intent is :
    A11: more and and strength


    Thanks.

    Hi. When I try to run the sub, it gives me an error 1004: Select Method of Sheet Class Failed. What am I doing wrong? Thanks in advance.


    Hi. I found a code. But I cant adjust it for myself. I want B2 and B6 cells as bold. Thanks in advance.


    Re: find value, copy and paste in previous cell.


    I think I couldnt express myself exactly. For Jack example, result should be like this:


    [TABLE="width: 143"]

    [tr]


    [td]

    1

    [/td]


    [td]

    TABLE

    [/td]


    [/tr]


    [tr]


    [td]

    2

    [/td]


    [td]

    WARDROBE

    [/td]


    [/tr]


    [tr]


    [td]

    3

    [/td]


    [td]

    CHAIR

    [/td]


    [/tr]


    [/TABLE]


    Thanks again. Please solve it:)