Posts by HankH

    Hello,


    How do I structure a VBA routine to make the statement below apply to any workbook. The code needs to execute the 'Windows(example.xls).Activate' statement when run from other workbooks where the workbook name will be predefined, but will vary from case to case. In all cases the macro would be run from the subject workbook.


    Code
    Sub Test()
    Windows("Example.xls").Activate
    End Sub


    Many thanks,


    Hank

    Hello,


    I need VBA to copy the values from a treadline output box on a chart to a new sheet. The macro recorder produces the code below, but I need to make the 5th line generic so that the code will apply to any workbook. The code below will not run without the "Windows("Test.xls").Activate" statement, which restricts the code to a workbook of a specifc name (Test.xls). How can I make this run for any workbook name?


    Many thanks for you suggestions,


    Hank