Posts by mikewaller

    Hello out there!


    I have a problem and where better to turn than the best excel forum in history!!!


    Bascially, I have a button on my worksheet that runs a macro when it is pressed. The problem I have is that the macro needs to know excatly where the button is on the worksheet. This is because I have lots of buttons my worksheet and what the macro actually does depends on where the button is!
    Hope someone can help....


    Regards
    Mike

    Hi


    The following expression looks up the value 5 in a lookup table called 'Figures':


    =LOOKUP(5, Figures)


    The number 5 is selected from the left hand column in the lookup table and the corresponding value in the right hand column is returned.


    However, is it possible to lookup the number 5 in the right hand column of the table and return the value in the left hand column?


    Thanks
    Mike

    Hello


    I've looked in Excel help to find a way to write an IF statement that varies on either of two conditions.


    eg.
    =IF(A1>1,1,0)


    The cell formula above returns a '1' when A1 is greater than 1.
    How about returning a '1' if A1 is greater than 1 OR A2 is greater than 1.


    I assume it is possible, but I just can't find the solution anywhere.


    Thanks to anyone that can help.


    Mike

    Re: Inverted commas within inverted commas


    Hi


    I'm still stuck with this problem. I've tried recording the action but it is the Cell().Address that I have a problem with.....


    The following line of code puts the value of cell B5 in cell A2 when Cell A1 is not empty:


    Code
    Cells(2,1).Value = "=IF(RC[-1]="""",0,$B$5)"


    However, I would like the B5 cell to be variable.
    ie. The value put in cell A2 is the value inside cell(RowNo, 3) where 'RowNo' is a variable.


    I've tried to modify the code above to do this but it doesn't work:


    Code
    Cells(2,1).Value = "=IF(RC[-1]="""",0," & Cells(RowNo, 3).Address & ")"


    Can anybody see what I'm doing wrong?
    Also I would like Cell A2 to be empty when cell A1 is empty, rather than return a zero. This involves using inverted commas again. Is this possible?


    Many thanks
    Mike

    Hello


    I am trying to use inverted commas inside inverted commas as shown below:


    Code
    Cells(2, 10).Value = "8"
    Cells(2, 11).Value = "= & "Number " & Cells(2, 10).Value


    If J2 contains '8' I want cell K2 to display 'Number 8'.
    If J2 contains '10' I want cell K2 to display 'Number 10'
    etc.


    Do you know how I can modify my code to do this?


    Thanks in advance
    Mike

    Re: Naming a Chart


    Hi Andy


    Thanks for your help. I still can't seem to get it to work though. This is my code for creating the chart:



    This code puts the chart on the worksheet. I now need to be able to move the chart.


    any ideas?


    Thanks again
    Mike

    Re: Naming a Chart


    Cheers Andy


    After naming the chart, I am now trying to move the position of the chart on the worksheet. Do you know how to do this?


    Many thanks
    Mike

    Hi


    I have created a chart using VBA but now want to write some code to move the chart around on my worksheet.


    The following lines of code will move the chart:


    Code
    ActiveSheet.Shapes(ChartName).ScaleWidth 0.81, msoFalse, msoScaleFromTopLeft
    ActiveSheet.Shapes(ChartName).ScaleHeight 1.24, msoFalse, msoScaleFromTopLeft


    However, VBA seems to recogise the chart as a shape (ie. say shape37). I need to be able to assign that name to my own variable (ChartName) so that I can request for that chart to be moved using the above code.


    Any ideas anybody?


    Many thanks
    Mike

    Re: Asking if active sheet is a chart


    Yeah it's definitely it's own sheet. I've even tried creating a new one and testing out the formula. Still doesn't respond.


    Does it definitely work on your PC? Maybe it is my version of Excel (I'm currently using Windows 2000 Prof).


    Thanks for your help here Dave
    Mike