Posts by WinteE

    Re: Speeding Up VBA Code


    This code puts 10 in cell A1 of each sheet in a workbook :


    Code
    Sub Test()
    
    
    For Each ws In ThisWorkbook.Worksheets
        ws.Range("A1").Value = 10
    Next ws
    
    
    End Sub

    Re: Speeding Up VBA Code


    Hi,


    You have to use the last row with a value


    Code
    i = ActiveSheet.Cells(ActiveSheet.Cells.Rows.Count, "A").End(xlUp).Row
    
    
    Range("A2:U" & i)


    Succes

    Re: Lock/Unlock Cells Based On Validation Lists


    Hi Ana,


    As you wrote "remember I'm using Excel 2010" I don't know if this is what you need (using Excel 2003 version).



    Success


    Erik

    Re: Count Mouse Clicks On Cell


    Hi,


    I've tried several events :


    Before right click -> Normally left click is used to select a cell
    Before doubbleclick -> Directs to the contents of the cell, selection change required to leave the contents



    Adding a selection change completes it.


    Erik

    Re: Count Mouse Clicks On Cell



    In Excel 2000 this is the only option that comes near. Don't know if a click event has been added to the Worksheet events. If there is you can use the same code in it.


    Erik

    Re: Error Within Nested For Loop


    Try this :


    Re: Lookup Function Error


    When using VLOOKUP with numbers I always use cells formatted as TEXT. The reason for this is that if the numbers in the SearchColumn aren't sorted you often get the wrong data.

    Re: Lookup Function Error



    Insert this code into a module of the workbook, and add a header to column B (e.g. "Town"). The code gives you an 'User defined function' for a combination of VLOOKUP and HLOOKUP.

    Re: Lookup Function Error


    Hi Natalie,


    I'm having no trouble with this after opening your attached file.


    You could try using VLOOKUP instead i your problem remains.


    Erik

    Re: Automatically Refresh Autofilter


    Put the next code into the Open event of the worksheet containing the filter :


    Code
    Selection.AutoFilter Field:=1, Criteria1:="Whatever"


    and the following code into the Change event of the worksheet you get the data from the web :


    Code
    Worksheets("Sheet1").Activate
    Selection.AutoFilter Field:=1, Criteria1:="Whatever"


    Erik