Posts by Brian Walters

    Re: Copy Based On Column Criteria & Append To Another Sheet


    The problem is that there aren't any headings and that the cells in rows 1-3 are merged. Replace this part of the code

    Code
    rwPaste =Range("A65536").End(xlUp).Row + 1


    with

    Code
    rwPaste = Application.WorksheetFunction.Max(Range("A65536").End(xlUp).Row + 1, 4)

    Re: Copy Based On Column Criteria & Append To Another Sheet


    So on Sheet1 it is pasting in rows 1-3? Put a macro stop (select the line and press F9) on this line of the code

    Code
    rwPaste = Range("A65536").End(xlUp).Row + 1


    Then close the workbook and the macro will pause at this line. The press F8 to step through the code to see what the value of rwPaste is and why it is pasting in rows 1-3.

    Re: Copy Based On Column Criteria & Append To Another Sheet


    Replace your code with this


    Now you can see exactly where the data from Client Info is getting pasted on Sheet1. You can change what goes where if I don't have it correct.

    Re: Duplicate A Master Sheet Changing Values With A Macro


    I'm not sure if this is your problem or not. I had an issue once trying to add many new sheets to a workbook. If you look under the Microsoft Excel Objects of the VB editor you will see that your sheets are listed as Sheet1 (Your 1st sheet name), Sheet2 (Your 2nd sheet name), etc. When I would add a new sheet, it would appear as Sheet11 (New sheet name). Once I got to Sheet1111111 I would get an error. Below is code to rename the CodeName of a worksheet.


    Code
    ActiveWorkbook.VBProject.VBComponents(ActiveSheet.CodeName).Name = "Sht" & ActiveWorkbook.Sheets.Count


    Hope this helps.

    Re: Hide Rows Accross All Sheets


    Try this


    Make sure this code is in a module and not the code section for a particular sheet.


    HTH

    Re: Copy Based On Column Criteria & Append To Another Sheet


    The attached .zip file contains a revised version of your file. I added a column on the Sheet1 worksheet for the column E information from the Client Info worksheet. I also deleted a lot of empty rows on the Client Info worksheet to reduce the size of the workbook. You can test the macro by putting in a new client number, date and something in N-Q. The macro runs upon closing the workbook. Let me know if you have any problems.

    Re: Unprotect Last Sheet After Deactivate, Custom Sort, Then Renable Protection


    Try this

    Code
    Public Sub data_global(WS As Worksheet)
        With WS
            .Unprotect "password"  '*** set this password to whatever you desire
            .Range("B4:M34").Sort Key1:=.Range("B4"), Order1:=xlAscending, Header:=xlNo, _
            OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom, _
            DataOption1:=xlSortNormal
            .Protect "password"    '*** set this password to whatever you desire
        End With
    End Sub


    HTH

    Re: Copy Based On Column Criteria & Append To Another Sheet


    What distinguishes one row from the next on the Client Info sheet? For example, if column A is a client account number and column B is a transaction date and there can never be a client number with two rows having the same transaction date, then we could copy rows on the Client Info sheet whose client number - transaction date combination does not appear on Sheet1.

    Re: Copy Based On Column Criteria & Append To Another Sheet


    If the data sheet will hold 1 year's worth of data (or maybe better yet the year-to-date data?) then is it possible to just replace everything in Sheet1 with any rows on Client Info with data in cells N-Q? Or if a match must be done, are there a limited number of fields that could be used to match on Sheet1 to see if the row has already been copied?

    Re: Macro Delete Rows If 7 Rows Exist


    Try this to keep those with 7 or more lines

    Re: Copy From Current Row To Varriable Row


    This code should work

    Re: Macro Delete Rows If 7 Rows Exist


    Try this:


    HTH