Results 1 to 8 of 8

Repeat a process on all visible sheets then combine

Threaded View

  1. #1
    Forum Contributor PY_'s Avatar
    Join Date
    09-23-2008
    Location
    Houston
    MS-Off Ver
    Office 2016
    Posts
    289

    Repeat a process on all visible sheets then combine

    I hope this makes some sort of sense:

    I have a few lines of code that i need to repeat on all visible sheets of a workbook. The number of sheets and names of sheets will vary on a job by job basis but the cell locations do not change.

    Here is what i am trying to repeat:

    Sub Copy_Sort()
    
        Range("U10:AF21").Copy
        Range("AU10").PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
            :=False, Transpose:=False
         Range("AU10:BF10").Sort Key1:=Range("AU10"), Order1:=xlAscending, Orientation:=xlLeftToRight, DataOption1:=xlSortTextAsNumbers
         Range("AU11:BF11").Sort Key1:=Range("AU11"), Order1:=xlAscending, Orientation:=xlLeftToRight, DataOption1:=xlSortTextAsNumbers
         Range("AU12:BF12").Sort Key1:=Range("AU12"), Order1:=xlAscending, Orientation:=xlLeftToRight, DataOption1:=xlSortTextAsNumbers
         Range("AU13:BF13").Sort Key1:=Range("AU13"), Order1:=xlAscending, Orientation:=xlLeftToRight, DataOption1:=xlSortTextAsNumbers
         Range("AU14:BF14").Sort Key1:=Range("AU14"), Order1:=xlAscending, Orientation:=xlLeftToRight, DataOption1:=xlSortTextAsNumbers
         Range("AU15:BF15").Sort Key1:=Range("AU15"), Order1:=xlAscending, Orientation:=xlLeftToRight, DataOption1:=xlSortTextAsNumbers
         Range("AU16:BF16").Sort Key1:=Range("AU16"), Order1:=xlAscending, Orientation:=xlLeftToRight, DataOption1:=xlSortTextAsNumbers
         Range("AU17:BF17").Sort Key1:=Range("AU17"), Order1:=xlAscending, Orientation:=xlLeftToRight, DataOption1:=xlSortTextAsNumbers
         Range("AU18:BF18").Sort Key1:=Range("AU18"), Order1:=xlAscending, Orientation:=xlLeftToRight, DataOption1:=xlSortTextAsNumbers
         Range("AU19:BF19").Sort Key1:=Range("AU19"), Order1:=xlAscending, Orientation:=xlLeftToRight, DataOption1:=xlSortTextAsNumbers
         Range("AU20:BF20").Sort Key1:=Range("AU20"), Order1:=xlAscending, Orientation:=xlLeftToRight, DataOption1:=xlSortTextAsNumbers
         Range("AU21:BF21").Sort Key1:=Range("AU21"), Order1:=xlAscending, Orientation:=xlLeftToRight, DataOption1:=xlSortTextAsNumbers
            
    End Sub


    After repeating the above on all sheets, i want to combine the values (using Paste:=xlPasteValues) of (BI10:DA21) from all visible sheets to a sheet called CSV_Export starting at A5 on that sheet and repeating doward till all visible sheets have been copied to that sheet. I have no idea of how to make it repeat on visible sheets.
    Last edited by PY_; 08-31-2010 at 12:49 PM.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1