Posts by noelleburr

    Hi,


    I am trying to figure out how I can copy and paste all objects from a worksheet (including charts) onto a single Powerpoint slide and loop through sheets 1-4 (my sheets are named as "1", "2", "3", "4"). All content from sheet 1 should be pasted on slide 1 in the powerpoint, sheet 2 to slide 2 and so on. Copied objects should be pasted with paste special as pictures.


    Here is my current code which pastes each chart onto an individual slide. Appreciate if I can get some help to adapt this to work as described above.


    This is code from the recorded macro, though I am looking for cleaner code that loops through all the unique values from the column to be filtered, hence my attempt at the code posted above.

    Realised my mistake with ActiveWorkBook shortly after posting my code there. I seem to have a couple other issues though. I have data from Column A to BD on my source file, where I need to filter through Column L and copy the results from Column A to BD to a new workbook, and repeat for each unique value in Column L. It is not working as I am hoping for at the moment.

    Hi,


    I need to filter a column and copy paste results into a new workbook until all unique values in that column has been filtered for. I am receiving a 'subscript out of range' error on this line:


    Code
    1. last = Workbk.Sheets(sht).Cells(Rows.Count, "L").End(xlUp).Row


    This is the full code:

    (I saved this code in my personal workbook and would like to run it on the active workbook)

    What it currently looks like

    Right, I've edited the file so that all my sheets start at A1 and the column to be filtered is at column G for all sheets. But I'm still getting the 'subscript out of range' error and it points to this code when I debug.

    Code
    1. wb.SaveAs Filename:=Output_Folder_Path & "_" & collection_UniqueList.Item(instance) & ".xlsx", FileFormat:=51

    Here it is. Essentially what is common across all sheets in this WB is the 'Division column'. This needs to be filtered to return results for each unique value, there are 5 - Abe, Sin, Cosin, Evb, Irel. I need 5 separate workbooks, named by each of these variables. The autofilter needs to repeat for all the other sheets in this WB so that in the new WB for Abe, I get 5 sheets that are filtered to only results for Abe, and the name of these sheets do not change. Remain as what is shown in the original WB.

    Edit to the above comment - could not edit it with the edit option. I'm getting 'subscript out of range' error 9. My column title row start at a different row for each sheet, ranging from A6-A8. The column to be autofiltered and copied into the new wb, this column number is also not fixed. But the column name is called 'Division'. Perhaps we need a code to work around these 2 things?