Posts by DMariotti

    How do I update multiple named ranges with VBA. I have a workbook with approximately 750 named ranges. I need to update part of the formula in all the named ranges. For example,


    Name: JumboDRL205 has a formula of =offset(KPIData!$D$288,0,0,1,Cover!$I$1). I need the cell reference: Cover!$I$1, changed to Cover$I$3 for all of the named ranges.


    Thanks
    Daniel

    Re: Worksheet Controls Text Direction Not Left to Right


    Dave,


    I originally did a search but could not find anything helpful. It only occurs on controls from the forms toolbar and only in a particular workbook. The basic question is how does one change the text direction of text on a control.



    Thanks,

    When placing a control on a worksheet, the text in the label,option box etc controls is vertical and I can't find a way of changing the direction to left to right. It doesn't happen on all workbooks. I can put the control on a "normal" workbook and then copy it to the "abnormal" workbook but I would like to know why/how I can change the direction of the text.


    Note:
    Under Tools/Options/International the text direction states left to right


    Thanks


    Daniel

    Re: Link Combobox To Pivot Table Page Field


    The part that was causing me a problem was passing the variable from the userform to the pivot table so it updated the pivot table. I solved it by moving that part of the code from a standard module to the click event on the userform.


    Code
    'Pivot tables to update with user selection
        Sheets("graphByDesc").PivotTables("PivotTable1").PivotFields("Description").CurrentPage = Product 
        Sheets("graphByDesc").PivotTables("PivotTable2").PivotFields("Description").CurrentPage = Product 
         
        Sheets("graphByDesc").PivotTables("PivotTable3").PivotFields("Description").CurrentPage = Product 
         
        ActiveWindow.SelectedSheets.PrintPreview



    It works fine now.


    Daniel

    Re: Link Combobox To Pivot Table Page Field


    Dave,


    Here is all the code.




    UserForm2 Code




    Thanks for taking the time,


    Daniel

    Re: Combobox Variable To Pivot Table


    Dave,


    In the Userform I have declared it as such



    Thanks,


    Daniel

    What I am tryng to do is pass the combobox selection to the pivot table current page field. The user makes a selection from the userform and the selecion is passed to three separate pivot tables. I don't want the user to get access to the pivot tables. The MsgBox indicates the correct selection but the pivot table doesn't accept it. It gives the follow error message;


    "Unable to set the default property of the pivotItem class"


    What am I doing wrong?


    Thanks,


    Daniel


    Code
    Load UserForm2
    UserForm2.Show
    Set product = UserForm2.ComboBox1
    MsgBox product
    
    
           Sheets("graphByDesc").PivotTables("PivotTable1").PivotFields("Description").CurrentPage = product
        Sheets("graphByDesc").PivotTables("PivotTable2").PivotFields("Description").CurrentPage = product
           Sheets("graphByDesc").PivotTables("PivotTable3").PivotFields("Description").CurrentPage = product

    I am reviewing a workbook and am trying to find out the number of formulae used. I thought using the specialcells and the count option on the status bar would give it to me but it doesn't return a value. I assume I could loop throught each workbook using the the special cells to return the value. How would I go about it in VBA?


    Thanks,


    Daniel

    Re: Listbox Result To Pivottable Current Page Field


    Dave,


    Thanks for the response. The listbox result was to feed into three pivot tables that supplied the soucedata for three graphs. I wanted the user just to make one selection only from the listbox and then pickup the graphs from the printer without any other input. I thought that the listbox would return a variable that I could easily use in a procedure.


    Regards Daniel