Posts by 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: Comparing values


    Hi tomgribbin


    I'm not sure wnat it is you want. But try to look at the attachment to see if it's that you want.


    Alring

    Files

    • Book1.xls

      (13.82 kB, downloaded 22 times, last: )

    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.

    Files

    • exsample.xls

      (16.9 kB, downloaded 26 times, last: )

    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

    Files

    • exsample.xls

      (13.82 kB, downloaded 23 times, last: )

    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
    1. Sub date_format()
    2. Range("A1").Select
    3. Selection.NumberFormat = "m/d yyyy;@"
    4. End Sub


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


    Code
    1. Private Sub date_format()
    2. Range("A1").Select
    3. Selection.NumberFormat = "m/d yyyy;@"
    4. 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
    1. Sub Open_()
    2. sdir = Cells(5, 1)
    3. ActiveWorkbook.FollowHyperlink sdir
    4. 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

    Files

    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

    Re: Copy and paste to word header


    Hi iwrk4dedpr


    Maybe it's because I use Windows XP and Excel/Word 2003 and not 2000.


    I don't know how to run a macro step by step. But it seems that Word is trying to do something. If I replace the last IF-statement so it look liik the code you gave me then I get a message saying:


    "One of the values passed to this method or property is put of range."


    So I need to have all the IF-Statement.


    Alring

    Re: Copy and paste to word header


    Hi iwrk4dedpr
    Maybe is should be childs play but it's not. For me. I have tried your code many times in different ways and all of them with the same result. Word is in normal view. Now the code look like this:



    Maybe I need to find my inner child to solve this. But right now Can't I find it.


    Alring

    Hi,


    I have made a mscro in Excel that can copy cells and paste them into the header of a Word document.


    After paste then the Word document is viewed in normal mode. I want it to be viewed in Print Layout View.


    I know that it's Word that don't do as I want it to do. But since the macro is in Excel and Word is "controlled" by Excel then i do believe that I have to ask here.


    I have attached the Excel file with the macro and the Word document in the same .zip file.


    alring

    Files

    • test_01.zip

      (18.09 kB, downloaded 146 times, last: )

    Re: Copy and paste cell into word cell


    Hi Roy


    I'm sorry but I don't understand why you have moved my quistion.


    The macro I have is in Excel and not in Word. The macro I have copy cells A1 and B1 into the same range in Word. In the word document I have inserted Excel cells. It's in there that A1 and B1 is pasted into. In Word the range is also A1 and B1. The macro works fine as long as the cells in Word is not inside the header. But I need to have this cells in the header of the word document.


    In other words: this have nothing to do with Word VBA but only Excel VBA because it's Excel that "controls" the Word in this case.


    Alring

    Hi


    I have a macro that can copy and paste Excel cells into Excel cells that is in a Word document. See the code below. My problem is to get the cells to be pasted into the Excel cells that i have in the header on the Word document.


    Code:


    I have tried to put in this code after "'insert cells" but it don't work.


    Code
    1. With appWD.documents(1).Sections(1)
    2. .Headers(1)
    3. End With


    Can someone please help me.


    Alring