Posts by WFischer

    Re: Userform Navigation


    ok thanks, that helps already.


    But what if I have another button on userform 3 that points to the Main menu? This code will always show userform 1 or 2 then as well. How to prevent that?




    Code
    Sub button_click() 
        Me.Hide 
        userform3.Show 
        me.show
     End Sub

    Re: Calculating hours "in" and hours "out" two different rates


    How about this?


    A lot of case distinctions, I know ;)



    edit: you have to convert time to nueric, e.g. 0830 -> 8.5, but that should be easy

    Hi guys,


    I want to achieve the following: Say, I have 3 Userforms and i want to be able to access Userform 3 via buttons in Userform 1 and 2.
    Userform 3 has a "back" button that redirects me to the previous userform.


    Is there an elegant way to do this?


    userform1:

    Code
    sub button_click
    
    
    unload me
    userform3.show
    
    
    end sub


    userform2:

    Code
    sub button_click
    
    
    unload me
    userform3.show
    
    
    end sub



    userform3: Pseudocode sth like


    Re: loop through all sheets and sort by cell colour


    Hi Roy,


    thanks for your reply. The only errors I get are occur when there are no red cells in my column, so that is fine.
    Also, I don't want to use "usedRange" since it is not updated properly. Sometimes it is larger than the actual used range, so this shifts some rows way too fat to the bottom.


    However, I kind of worked around the problem meanwhile, but I do not quite understand it:


    Code
    mysheet.activate


    at the beginning of the code solves it, but i have no idea why it is necessary. Somebody knows?


    Thanks,
    Willi

    Hi guys,


    I want to loop through all sheets and sort by color, so that red cells come to the bottom. I loop through every column because red cells can be in every column.
    This is my code. It works fine, but only works in the activesheet and doesnt loop through sheets.


    Any ideas?


    Thanks!


    Hi guys,


    I have this problem:


    I create a Word dosument with Excel VBA. Now I want to insert a graphic into the header. Since several people have to use the Excel workbook, the graphic is not saved in a separate file. Instead i have put in in an extra sheet in my workbook.


    How can I put this graphic to the Word document header (and change size and position)?


    To avoid misunderstandings: I do not use Word VBA entirely, only Excel VBa is used.


    I have experimented with the macro recorder, but something like this does not work:



    Code
    Dim objHeader As Object   
    
    
    Worksheets("Logo").Shapes.Range(Array("Group 4")).Copy
    
    
    Set objHeader = wdApp.ActiveDocument.Sections(1).Headers(1)
    objHeader.pasteandformat


    I have psoted this already here (German)
    http://www.herber.de/forum/arc…1336/t1335594.htm#1335594


    I hope for your help


    Thanks,
    Willi