Posts by alring

    Re: Colour cell


    Hi pangolin


    I can't get CONDITIONAL FORMATTING to work in another cell than the cell where I have written S or L.


    I can get CONDITIONAL FORMATTING to work in cell A1, but not in cell B1 because cell B1 is empty. But according to what is sritten in cell A1 then should B1 be coloured too.


    Alring

    Hi there


    If I in cell A1 have the letter S or L then I want that cell B1 change the background colour. Is that possible with VBA?


    Alring

    Re: Sheet name


    Hi pangolin


    Thank you for your reply. It is working perfect for me. :rock: But you probely already new that.


    :thanx:


    Alring

    Hi there


    I want to rename an Excel Sheet. I have the name in a cell. Is it possible to link the Sheet name to a cell?


    Alring

    Re: macro that open header


    Hi Andy


    Yes i did. But in a wrong way. With the last code change for you it works.


    Ones again. Thank you so mush for your help. What would I do without you?? I know: Be very lost. :rock:


    :thanx:


    Alring

    Re: macro that open header


    The only problem I have now is that the code paste the cells from Excel into the document that it's open and not to the document mensioned in cell ("C26").


    Alring

    Re: macro that open header


    Hi Andy


    I knew that I was doing something wrong. Because now it works as it should.


    I thank you so mush for your help.


    :thanx:


    Regards
    Alring

    Re: macro that open header


    Hi Andy


    There is something wrong here. Maybe it's me. The change for it is very BIG.


    When I run your code in Excel then I get the message "User-defined type not defined". I get that in the line with "Dim appWord As Word.Application"


    When I then delete the first 3 lines in your code then I get to the line with ".Headers(wdHeaderFooterPrimary).Range.Paste" and get a new message saying "The requested member of the collection does not exist".


    Am I doing something wrong?? Again here is the change very BIG.


    Alring

    Re: macro that open header


    Hi Andy


    Thank you for your reply. It seems that I can't use that. Meaning that I can't get it to work.


    The macro I have now look like this.
    [vba]Sub Button1_Click()
    Range("A1:D4").Select
    Selection.Copy
    intPrintJobs = Range("A24")
    aNameAndPath = Range("C26")
    Range("A7").Select
    Set appWD = CreateObject("Word.Application")
    appWD.Visible = True
    appWD.documents.Open Filename:=aNameAndPath
    appWD.Selection.Paste
    Application.CutCopyMode = False
    appWD.ActiveDocument.PrintOut , Copies:=intPrintJobs
    End Sub[/vba]


    ("A24") is the numbers of print I want.
    ("C26") is the document I want to open.


    Range ("A1:D4") is what i want to copy into the header of the Word document.
    I have tried what you said, but I get it to work. Maybe I write it wrong. maybe you can change my code so it works.


    Regards
    Mads

    Hi All


    I need an Excel macro that can open header in Word. The macro I have now can open a Word document and copy some of the cells from Excel to Word. But I need that cells are paste into the header of the Word document. I have tried to record a macro in Word that open the header and then copy that into the Excel macro. But Excel don't accept that code.


    Hope someone can help me.


    Regards
    Alring

    Re: Vlookup


    Hi minitman


    Sorry but I can't help you with that. As fare as i can see then you have to live with the 0.


    Sorry


    regards
    Alring

    Re: Vlookup


    Hi minitman


    If you look in cell Q3 then you can see what you should write. It's the only cell I make change in.


    Hope you can use this.


    Mads

    Files

    Re: Copy cells


    Hi h1h


    Thank you for your reply. When I try to record the macro then nothing happens. I can't record a excel macro at the same time as I do something in word.


    Mads

    Hi all


    I have a macro in Excel 2003 that opens a Word document. And it's working as it should. Now I also want that macro to copy some of the cells from Excel to Word. I have made Excel cells in Word and it's there I want to paste the cells from Excel.


    Is that possible??


    Mads

    Re: VBA to Print a Word Doc.


    Hi Brian


    This code here open and prints the word document.

    Code
    1. Sub Open_print_word_Click()
    2. '
    3. intPrintJobs = Range("A24")
    4. aNameAndPath = Range("C25")
    5. Range("A3").Select
    6. Set appWD = CreateObject("Word.Application")
    7. appWD.Visible = True
    8. appWD.Documents.Open Filename:=aNameAndPath
    9. appWD.ActiveDocument.PrintOut , Copies:=intPrintJobs
    10. End Sub


    intPrintJobs = Range("A24") is the numbers of copies you want of the word document.
    aNameAndPath = Range("C25") is the name and path of the word document you want to print.
    If you change appWD.Visible = True to appWD.Visible = False then you don't open the document first but just print it.


    Mads