Posts by Simon Lloyd

    Re: Error 91 When Closing


    atjensen11 you need to post the code here, dont forget if you do you need to highlight all your code and then click the # icon to wrap code tags around it.


    regards,
    Simon

    Re: Update Cell Value


    Findeep, you don't have to use a checkbox you could use Y or N or Yes or No,


    In column A you have your dates, in column B You Could just enter Y for that date to appear on another sheet, the way you could do this is like this:- paste this where you would like the date to appear on the other sheet, lets say in A1

    Code
    =IF(Sheet1!B1="Y",Sheet1!A1,"")

    then copy it down for as many cells as you would have dates for.


    The formula reads like this If Sheet1 cell B1 has the value Y then return the value of Sheet1 cell A1 If no Y is present return a blank, it does not matter if you use a capital Y or lower case y use on the sheet.


    Hope this helps,
    Regards,
    Simon

    Re: Clear Contents And Change Colour Index Of Cells


    Right!, here we go............you need to format all your cells where numbers would appear i.e 00002 (including the ref No. cells) as text this way when the search takes place it will actually look for all of the exact number!, I have added some code in named macro 2 as shown below, i have also made a note in your workbook of what you need to do.


    Regards,
    Simon

    Re: Open Files, Copy Paste To Master Workbook


    Hi i modified the code, ran it and it worked perfect every time!


    Regards,
    Simon

    Re: Trigger Filter With Cell Change


    FreeBrownies, i think you may need to replace this line

    Code
    If Target IsEmpty(Target) Or IsNotNumeric(Target) Then

    so your code looks something like

    again im not entirely sure here but its my best guess!


    Regards,
    Simon

    Dave, thanks i try with what limited knowledge i have, if you dont mind take a look at the code below, i read your article and added the appropriate line, the code works fine except the msgbox has to be ok'd twice before it exits sub any ideas why?


    Regards,
    Simon

    Re: Stop Blanks in Entry Range


    LOL! Dave my code only works to a fashion as im no expert, the event is triggered no matter what cell you click, i just didnt know how to only get it to work in the specified range like column A.


    Regards,
    Simon

    Re: Combo Box Firing A Worksheet Change Event


    All i can imagine is that if you get a criteria match in the combobox then select a cell like:

    Code
    If UserForm1.ComboBox1.Value = 1 Then
    Sheets("Sheet1").Range("A1").Select
    End If

    then of course you will have code in the worksheet change event for that sheet.


    Regards,
    Simon

    Re: Open Files, Copy And Paste Into Master Workbook


    I may not have got this right (i'm sure someone will tell you if i havent) but i have added a couple of lines in the code below:
    This one

    Code
    Dim rng

    and

    Code
    Set rng = Sheets("Sheet1").Range("B65536").End(xlUp)(2) ''''assuming your pasting to sheet1

    and

    Code
    rng.Select


    Like i said not entirely sure im right but give it a go!
    Regards,
    Simon

    Re: Copy Event Code To Other Workbooks


    The problem looks to be (although im not sure because i didnt put this together!) that you are opening a workbook

    Code
    Workbooks.Open ("G:\Variance Reports FY07\Individual Variance Reports\11 Admin.xls")

    then later on in the code you are selecting the folder where you want to open the workbooks and perform the action

    Code
    .LookIn = "G:\Variance Reports FY07\Individual Variance Reports"

    so in other words you are trying to modify the ThisWorkBook module of the workbook that is initiating the procedure

    Quote

    Quote:
    Originally Posted by Johnske
    Put all the workbooks that need the new ThisWorkbook procedures into a folder with the book containing the new procedure.


    Put this code into a standard module in the book that contains the new procedure and run it (make sure all the other workbooks are closed as I didn't add code to check if thay're open) - this is basically a 'copy and paste' for a VBE module

    as you see here Johnske tells you to make sure all the workbooks are closed, you have one open....the one thats doing the work, it shouldnt be in that folder (i dont think!), he also tells you to put this procedure in the workbook that is going to pass the procedure to the other books NOT put it in the same folder!


    Clear these few things up and it should work fine.


    Regards,
    Simon

    Re: Select Variable Range


    Perhaps something like

    Code
    Range("A1:C" & i).Select

    Give it a go, im not sure how to achieve it i havent been coding too long myself but i had a problem with something not to far from what your trying to achieve and i was given a similar solution!


    Regards,
    simon

    Re: No Blank Cells


    Its something like this but i dont know exactly how to get the action to only work if a cell in rng is selected


    Hopefully this will help you on your way or spark some replies for you,
    Regards,
    Simon

    Re: Triggering Filters With Changes To Cell


    Hi i'm not entirely sure what your after, but assuming your priority data is in column A the following code will show an input box where the user can enter a priority figure and then the worksheet will be automatically filtered to your requirements. The code could be triggered by a command button.


    Regards,
    Simon

    Re: Copy Vba Code To Thisworkbook Object


    This code was provided to me by Johnske at VBAExpress for a similar reason.

    Quote from Johnske

    Put all the workbooks that need the new ThisWorkbook procedures into a folder with the book containing the new procedure.


    Put this code into a standard module in the book that contains the new procedure and run it (make sure all the other workbooks are closed as I didn't add code to check if thay're open) - this is basically a 'copy and paste' for a VBE module



    Regards,
    Simon