Posts by alring

    Re: Continue macro


    Hi there


    I got it not. I have changed the code total after trying alot of different things. So now it's working. The code look like this now.


    Regards
    Alring

    Re: Continue macro


    Hi


    I have changed the last part of the code. It's the part after:


    Code
    Application.CutCopyMode = False


    I have changed it to:


    The path for the file is in A9 and the filename comes from D1 and D2. and it's working as it should.
    But I still need to put in a message box that will come if the file don't exist. I have tried to put the code for the message box in after "Exit For" but then I have to press OK 18 times before the message box disapear again.
    So if some one knows where I can write the code for the message box then I will be gratefull.
    Alring

    Re: Continue macro


    Hi Wigi


    This is a short code. the right one is very long because I open about 20 Word documents. But it's the last part where I want to open bNameAndPath that where I want to macro to see if the file (Range A10) is there and then print it. If it's not there then come with a message box saying it's not there and then end the macro.



    Alring

    Hi


    I have a macro that prints alot of other documents. All the documents is listed in Excel. The macro looks into some cells and print the document that is written in those cells. My problem is that the last document that the macro prints maybe isn't there. Meaning that the document maybe isn't made yet. How can I get the macro to see if the document is there? And if it's there then print the document. And if it's not there then a mesage box should come telling that the document can't been printed and then end the macro?


    Alring

    Re: Vlookup without false


    Hi again


    I’m happy to tell you that I have found a third way to skin the cat.


    Since I don’t want to change the order to Descending and I also want that if the number I write in A1 is present in the array then I have changed the formula. I have used Biz’s solution and combined it with Counta. Now the formula works as I want it to.


    Both Dave and Biz THANK you for the help and guide dings.


    Please take a look at the example to see the solution.


    Alring


    PS:. Thank you for a perfect forum.

    Re: Vlookup without false


    Hi


    Dave>> It was my mistake. Your formula works perfect. Sorry. And THANK you for the help.


    Biz>> Your formula works perfect also. THANK you for the help.


    Now I just have the problem to pick one of them. But that's my problem.


    THANK you both.


    Alring

    Hi,


    I have a small problem. When I use Vlookup and don't put "False" in the code then Vlookup find a match that is lower and nearest to the number I want to lookup. How can I make it so it will give me the number that is nearest but up? Meaning that if I write 220 then the result should be 6 and not 5.


    Please take a look at my exsample.


    Alring

    Re: international date settings


    Hi,


    Why don't you format the cell to be US date format??


    If you want to use VBA you can write this if the date is in A1:


    Code
    Sub date_format()
    
    
        Range("A1").Select
        Selection.NumberFormat = "m/d yyyy;@"
    
    
    End Sub


    Or you can under Sheet1 code write this code if the date is in A1:


    Code
    Private Sub date_format()
    
    
        Range("A1").Select
        Selection.NumberFormat = "m/d yyyy;@"
    
    
    End Sub

    Re: Hyperlink


    Balu


    A similar code works perfect on my computer. Remember to format A1 on sheet SAP2 to be a hyperlink.

    Re: Open Hyperlink with no warning


    Hi Roy


    Thank you for your reply.


    I'm still geting the warning.


    By the way the warning also say: "Some files can contain viruses or otherwise be harmful to you computer. It's important to be certain that the file is from a trustworty source."


    Sorry I didn't write the first time.

    Hi,


    I have made the below macro. In cell (5,1) I have a hyperlink that start with http://..... and so on. When I run the macro then I get a warning askin me if I want to open the file the hyperlink is connected to. What can I write in the macro so I don't get this warning?


    Code
    Sub Open_()
        
        sdir = Cells(5, 1)
        ActiveWorkbook.FollowHyperlink sdir
    
    
    End Sub


    Alring

    Re: Vlookup in second colum


    Hi Seti


    Thank you for the help. You helped me alot there. I didn't think so long to use Index/Match. Maybe I just need a extra brain.


    Again. THANK YOU

    Hi


    Normal when I use vLookup then the value I lookup is in the first colum. Is it possible that the value I use to lookup with is in the second colum instead of the first?
    Another problem to this that I also need the result from the first colum.


    I have attached an exsample. On sheet2 is the table array.


    On sheet1 is it cell A2 I want to lookup in the table array.


    alring

    Re: Copy and paste to word header


    Hi


    Now I got the solution for my problem. See below:


    Maybe someone can move this back to Excel help, because it's a Excel VBA.



    this macro also print and close the document.


    alring

    Re: Macro to input picture in cell and also delete picture


    Hi Fendore


    Thank you for your reply. The picture have to be put in a cell that have been decribe in the macro.


    Also when we start a new year then the picture have to be deleted again.


    To explain a little bit more. Is't the pictures of the moon I want to put in the calender. Pictures that show if the moon is full or new.


    Alring