Results 1 to 6 of 6

Combining separate macros into 1 macro.

Threaded View

  1. #1
    Forum Contributor
    Join Date
    08-07-2012
    Location
    US
    MS-Off Ver
    Excel 2010
    Posts
    202

    Combining separate macros into 1 macro.

    Hello all. I have a set of 16 macros with each on it's own button. I would like to make one button that will call on each of these macros and make them all run. I've been looking and playing around with it trying to get it to work but can not get it into my head correctly to get it to work. (I keep getting errors).

    If I can see how to add P12SET to P11SET I think I can get the rest from there. If someone can show me that I'd really appreciate it. They are just simple copy/paste macros with two different conditional formattings. They are all named P11SET thruP116SET, if that helps. Once they get to P19SET, it switches to P110SET and so forth until it gets to P116SET.

    Here is a couple of the macros of the 16. Thank you all so much!!!


    Sub P11SET()
    '
    ' P11SET Macro
    '
    
    '
        Range("DK71:DL72").Select
        Selection.Copy
        Range("G68").Select
        Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
            :=False, Transpose:=False
        Range("DO53:DO62").Select
        Application.CutCopyMode = False
        Selection.Copy
        Range("DP53").Select
        Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
            :=False, Transpose:=False
        Range("EG53:EG62").Select
        Application.CutCopyMode = False
        Selection.Copy
        Range("EH53").Select
        Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
            :=False, Transpose:=False
        Range("DO65:DO74").Select
        Application.CutCopyMode = False
        Selection.Copy
        Range("DP65").Select
        Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
            :=False, Transpose:=False
        Range("EG65:EG74").Select
        Application.CutCopyMode = False
        Selection.Copy
        Range("EH65").Select
        Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
            :=False, Transpose:=False
        Range("AG52").Select
        Application.CutCopyMode = False
        Selection.FormatConditions.Add Type:=xlCellValue, Operator:=xlEqual, _
            Formula1:="=0"
        Selection.FormatConditions(Selection.FormatConditions.Count).SetFirstPriority
        With Selection.FormatConditions(1).Font
            .ThemeColor = xlThemeColorLight1
            .TintAndShade = 0
        End With
        Selection.FormatConditions(1).StopIfTrue = False
        Selection.FormatConditions.Add Type:=xlCellValue, Operator:=xlBetween, _
            Formula1:="=1", Formula2:="=10"
        Selection.FormatConditions(Selection.FormatConditions.Count).SetFirstPriority
        With Selection.FormatConditions(1).Font
            .Bold = True
            .Italic = True
            .Color = -16711936
            .TintAndShade = 0
        End With
        Selection.FormatConditions(1).StopIfTrue = False
        Range("X74").Select
    End Sub
    
    Sub P12SET()
    '
    ' P12SET Macro
    '
    
    '
        Range("DK73:DL74").Select
        Selection.Copy
        Range("G68").Select
        Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
            :=False, Transpose:=False
        Range("DO53:DO62").Select
        Application.CutCopyMode = False
        Selection.Copy
        Range("DQ53").Select
        Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
            :=False, Transpose:=False
        Range("EG53:EG62").Select
        Application.CutCopyMode = False
        Selection.Copy
        Range("EI53").Select
        Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
            :=False, Transpose:=False
        Range("DO65:DO74").Select
        Application.CutCopyMode = False
        Selection.Copy
        Range("DQ65").Select
        Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
            :=False, Transpose:=False
        Range("EG65:EG74").Select
        Application.CutCopyMode = False
        Selection.Copy
        Range("EI65").Select
        Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
            :=False, Transpose:=False
        Range("AH52").Select
        Application.CutCopyMode = False
        Selection.FormatConditions.Add Type:=xlCellValue, Operator:=xlEqual, _
            Formula1:="=0"
        Selection.FormatConditions(Selection.FormatConditions.Count).SetFirstPriority
        With Selection.FormatConditions(1).Font
            .ThemeColor = xlThemeColorLight1
            .TintAndShade = 0
        End With
        Selection.FormatConditions(1).StopIfTrue = False
        Selection.FormatConditions.Add Type:=xlCellValue, Operator:=xlBetween, _
            Formula1:="=1", Formula2:="=10"
        Selection.FormatConditions(Selection.FormatConditions.Count).SetFirstPriority
        With Selection.FormatConditions(1).Font
            .Bold = True
            .Italic = True
            .Color = -16711936
            .TintAndShade = 0
        End With
        Selection.FormatConditions(1).StopIfTrue = False
        Range("X74").Select
    End Sub
    Last edited by greenfox74; 12-13-2017 at 03:24 PM.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Help me break this macro into two separate macros?
    By taylorsm in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 09-15-2016, 01:24 PM
  2. macro combining separate print jobs into 1
    By enwoznick in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-13-2016, 11:34 PM
  3. [SOLVED] Issue with combining two separate Worksheet_Change macros...
    By evlsnk in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-29-2015, 09:34 AM
  4. Combining Macros. Automate Everything to one Macro
    By Winniethemu in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-22-2015, 07:38 PM
  5. [SOLVED] Combining several small macros into one large one AND Conditional/Sorting Macro Issues
    By lashellr in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 10-10-2014, 11:59 AM
  6. Combining individual macros into one module/macro
    By Nett in forum Excel Programming / VBA / Macros
    Replies: 14
    Last Post: 05-20-2010, 03:00 AM
  7. Identifying macro starting point & combining macros
    By dagindi in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 11-25-2009, 10:31 AM

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