Posts by DebugMe

    A huge thanks to both of you!

    I'm sorry to bother you with basic (mostly recorded) macro like this, but for what it's worth it is really helping me improving my VBA skills seeing your solutions. Especially the point about using my Table features!

    Thanks again!

    Oh sorry!
    It's on the Forecast AC sheet. but the macro will be assigned to a button the SAPImport sheet hence: 'Sheets("Forecast").Select'
    Then i search for the month givin by the named cell "PreviousMonth" that is
    =TEXT(DATE(2020;IF(MONTH(TODAY())-2>0;MONTH(TODAY())-2;12);1);"[$-409]MMMM")

    This will find the header cell and then i Offset and select the whole table column:


    Cells.Find(What:=Range("PreviousMonth").Value, LookIn:=xlValues).Offset(1, 0).Range("A1").Select


    Then i what the formula in this table colunm to be draged / autofilled to the next month (the adjacent right table column)


    Selection.AutoFill Destination:=ActiveCell.Range("A1:B101"), Type:=xlFillDefault

    It was the only way that i could come up with, that made my VBA 'dymanic'.I know that there's probably a smarter way to work around this, but it was what i could come up with with my VBA skill-set.

    Hey there


    I think i have a really simple problem, but i suck at VBA, and have tried to find someone with a similar problem without luck.

    So i use "Find" to find my source range (a column within a table -a new one every month, hence the 'find' part), and then i want to autofill this range one column to the left. But the following code gives me an error when i run it.

    Could someone tell me what i do wrong with autofill?



    Code
    1. Sub Autofill()
    2. Sheets("Forecast").Select
    3. Cells.Find(What:=Range("PreviousMonth").Value, LookIn:=xlValues).Offset(1, 0).Range("A1").Select
    4. Range(Selection, Selection.End(xlDown)).Select
    5. Selection.AutoFill Destination:=ActiveCell.Range("A1:B101"), Type:=xlFillDefault
    6. End Sub

    Hi,


    It's the VBA noob again :S


    I have made a userform for data imput with a listbox (10 columns: A:H) showing all the data in sheet1, but i have tried to change this so the listbox only show the data matching the selected name in comboboxName (column A in sheet1). But now my listbox show all in one column. I guess i don't use .addItem rigth?

    Can anyone help me on this issue?

    Well they work, but i would like the Project Name box, to give all projects that contain e.g. the number 3 when this is typed in, not just the project names that starts with 3. Does that make sence?

    Hey there

    I'm brand new to VBA in excel and am creating my first userform. I've managed to create dependent combobox (my 'Project Name' Combobox depends on the 'Type' Combobox), but since there are a LOT of project names I would like this combobox to be a bit more flexible in terms of searching when typing. More specifically when typing a letter (or letters) I would like a list with suggestions that include all entities that include these, not just the ones that starts with those letters as it does in my combobox in my userform (I have tried to illustrate what i mean in sheet 'Searchable Drop Down'). I have found different suggestions on how to do this, but I can't get it to work with my dependent combobox. Could anyone help me on this issue?


    Thanks!

    Timeregistrering userform Develop - AnonymizedCopy.xlsm