Posts by DBR138

    I over simplified. I am defining a range for my source data an the specific columns I want to keep along with output order. Here is a better representation of the code before I go on to apply an advanced filter criteria:


    So I will need to come up with a way to derive the column numbers used in the red lines above based on the column name in row 1 rather than assuming the columns will always be in the same order.

    My current macro identifies the columns I want to output and the order in which to do so as follows:

    Code
    columnsToKeep = Array(1, 13, 36, 2, 3, 24, 8, 12)


    I am running into problems because the source data is no longer going to be in the same order consistently. There will always be a heading in row 1 and the values will remain to accurate to the data below so I want to use that value but can't seem to make it work. The result would end up something like:

    Code
    columnsToKeep = Array(Item, Sequence, Sales Order Priority, Batch Number, Lot No, Firmed, Header/Line Status, Req Compl Date)


    I realize that I will end up needing to define these but I am not sure how to put it all together.


    Thank you!

    I believe that the problem lies within this smaller section of code. perhaps I need to re define my range after the data is filtered rather than using dataArray again?



    The example data is only a partial example but I expect this will fill your need. Let me know if it doesn't.


    Code
    Sub Delrow()
        Dim N As Long, i As Long
        N = Cells(Rows.Count, "K").End(xlUp).Row 'Count column K to determine range.
        'Using K because it appears to always have a value if the line is used for anything
        For i = N To 1 Step -1 
            If Cells(i, "C") < 1 And Cells(i, "G") < 1 Then
                Cells(i, "C").EntireRow.Delete 
            End If
        Next i
    End Sub

    I have the following macro that is intended to filter the data tab based on the two specified criteria and then paste the remaining lines into the report. The filters work properly but it is pasting even the hidden rows into the report and I can't figure out how to get it to only paste the visible lines. I am pasting my code below. Has anyone experienced this issue before or know how I might resolve it?



    I am trying to automate the creation of a report that I presently make to such a level that I can push it onto the users who are not known for their computer skills. I enjoy macros and VBA but this is a little more ambitious than I have gotten so far. I am attaching a sample file containing the source data and the template it will end up in. What I need to do is for each cell in column C of the Data tab where H is not "QC-Completed" and U is blank the copy S, AD, B, C, E, H, L and paste them into the next unused row on tab Pass On in the order I listed to cut them so S would go to A and AD would go to B and so on.
    I am hung up on the multiple conditions and I do have a tendency to over think these things.


    Ideally this would fit into the following code that I have already written: