Posts by 'tiz Tastic

    Re: Autofilter then copy results to new Workbook


    Hi KjBox,


    I made some minor adjustments which seemed to work, had a "Eureka!" moment but me being a bit daft the DB sheet was active.
    Your final adjustment is what did the trick! Thanks a bunch!


    Still trying to get my head around the column selection and rearranging..



    Thanks again,
    Kevin

    Re: Autofilter then copy results to new Workbook


    Thank's KjBox,


    This handles the column selection and reordering magnificently, unfortunately it's copying all records not just the filtered. Also loses the header formatting
    Took me a while to figure out what was going on, bit advanced for me (getting back into VBA after being away for yonks)



    Cheers,
    Kevin

    Re: Autofilter then copy results to new Workbook


    I have removed the instruction and added the following which is working wonderfully now


    Code
    rngResult.Copy Workbooks.Add.Sheets(1).Range("A1")


    now a Subscript error is occurring when trying to remove the filter and Show all data:

    Code
    ActiveSheet.AutoFilterMode = False
                                If ActiveSheet.FilterMode = True Then
                                ActiveSheet.ShowAllData
                                End If


    What would be the best method to use to select the the original Workbook and filtered worksheet?



    Cheers again!


    Kevin

    Hello Folks,


    Been battling copying the results from a specified worksheet to a new workbook.
    Now I know the Autofiltering works fine, but as soon as I start adding copying functions, I get a "Subscript out of range" error starting at IngLastrow and for the life of me, I cannot figure out why.


    strStart and strEnd will be user textbox values





    I know it may be cheeky to ask but my next step is to try specify a range to copy and order then like so: B:B,A:A,E:E,D:D,I:I,J:J,AQ:AQ. Doing the selection before copying to the new sheet may complicate things so I was thinking ordering then removing excess columns after being copied?


    Any advice, help or suggestions would be greatly appreciated!


    Cheers,
    Kevin

    Hello there,


    Forgive my ignorance, it's been many a year since I have been working with VBA.
    I'm currently trying to get a function working where there should be matching cells in two different columns on the same row, but if there is no match then apply a date stamp in a 3rd column.
    I can get the date stamp to work but only if 1 column changes and doesn't match - but what I am trying to achieve is if either of the two columns change and don't match - apply a date stamp and If they do match, remove the date stamp and finally if one of the cells is blank; remove or don't apply a date stamp.





    Any advice would highly be appreciated,


    Cheers,
    Kevin