Posts by eivstei

    Yes, it is the format dd/mm/yyyy i want to use, and it seems like that format in the worksheet, but excel doesnt recognize it as date, but text, and therefore it sorts wrongly. The april line stays at the top, and latest dates seems to place randomly. I have tried to change format both in worksheet and vba, but cant get it right.

    Thanks Roy for going through all my vbas. The change button works properly now. Nice!

    But there came two new problems, perhaps you have a solution for that too?

    1: The listbox in form do not have headings longer.

    2: But more importenly, I want the newest entries to be first/at the top in the table/listbox, (because newest will be most relevant for users to look at).


    I'm trying to use a vba to insert a row, and copy dynamic formulas from above.

    I have problem with formulas like "=SUM($F$9:F12)". The new row get the same formula, but should get "=SUM($F$9:F13)".

    My vba code is like this:

    ' Q4 is input to define which row to insert new.

    Dim verdi As Variant

    verdi = Range("Q4").Value


    ' Copy formula from cell above

    Rows(Selection.Row - 1).Copy

    Rows(Selection.Row).Insert Shift:=xlDown

    End Sub

    Ok, I will do some more research about that. But thank you so much royUK for your time and help. Your code is very helpfull. I will study it more and try to find a way to paste it ether as picture or make it work as it is. The code in my first post did save the range as pictures, so it should be possible.

    But again, I am grateful for your commitment to help me.

    Thank you for your reply.

    I have a workbook template with closing accounts. Each month, several areas of this workbook will be copied into Word for presentation and printing.

    To make copying more efficient, I want a VBA that copies the areas by the touch of a button. It should be possible for my colleagues to edit the areas to be copied, even if they have no knowledge of VBA. Therefore, I want the VBA to copy areas based on the values in the cells F3:F20. I do not know if it is best to define an area name or location (for example sheet1! B2: G10) in the F coloumn.

    The code I have written will copy the named range valued in F3, and paste it as a picture in a new word document.


    I want to copy several ranges in a workbook to one Word document. How do I do that with a VBA?

    In this example, I have defined the ranges with names. In "sheet3", I want range F3:F20 to be cells that users can type in which name ranges they want to export to Word.

    This code does work if the named range is in the same sheet as the button. But I need it to work when the named ranges are in another sheets.

    I also need this code to copy next named range valued in the F3 cell, and down to end of list.

    I appreciate your help