Posts by nimrod1313

    Hello AK :

    I'm thinking your problems start with your codes lines ..

    Code
    On Error Resume Next
    Set ws = Sheets("search")


    You cannot set WS to the sheet named "search" because the sheet is "Search" (i.e. upper case "S").

    But your "On Error" allows you to proceed even though no sheet has been set to "WS".


    Cheers.

    Hello PVMan;

    Justins work is great ! But here is some code that might clear up the new requirements (e.g. cells with no values and leading zeros) ... if you'd like.

    If you want to continue and wait for Justin to get back to you , that's cool too.

    cheers


    Hello RoyUK :)

    I tried the code you provided above but not sure if I'm doing something wrong. Fred has requested the cutting of all odd number cells in Column C ... but when I use your code it cuts all the cells . i.e. including C2, C4 which Fred had indicated he did not want cut. ... I'm I missing something ?


    Cheers

    Nimrod11313

    This solution requires the work orders to be sorted into order prior to the running of code.


    Hello:

    When I watch the video I do notice one odd thing. The project window shows that you've created a module BUT the "Sheet1" is what is highlighted. So the code you're looking at is in Sheet1 and not the module. Check to see what has been produced in the code window in both places. Clear both the code from sheet1 and module1 and try recording again. I wondering if the ".Header. = 12" is a line in the Sheet1 code window that's causing the problem.

    I used the workbook function Advanced Filter and Countifs to come up with this Soln ... maybe you will find it interesting.


    Code
    Sub Copy_sheet_1_to_another()
        Call copyRange("B17:E22,I17:L22,A24:F24,B47:L49,U20:Z20,U22:Z33", "Proposal 1", "Proposal 2")
    End Sub
    
    Public Sub copyRange(ranges As String, sourceSheet, targetSheet)
        Dim rngAddr
        For Each rngAddr In Split(ranges, ",")
            Sheets(sourceSheet).Range(rngAddr).Copy Destination:=Sheets(targetSheet).Range(rngAddr)
        Next rngAddr
    End Sub