Results 1 to 6 of 6

Combining macros to be one and run in a specific order

Threaded View

  1. #1
    Registered User
    Join Date
    08-03-2012
    Location
    Manchester
    MS-Off Ver
    Excel 2010
    Posts
    24

    Combining macros to be one and run in a specific order

    Hey, I'm novice with VBA so I'm not familiar with combing macros to be one and run in a specific order. This is what I was trying.

    Sub OneButton()
    
    Dim FoundCell As Range
    Dim myWords As Variant
    Dim wks As Worksheet
    Dim iCtr As Long
    
    myWords = Array("Internal meeting")
    Set wks = ActiveSheet
    With wks
    With .Range("G:G")
    For iCtr = LBound(myWords) To UBound(myWords)
    Do
    Set FoundCell = .Cells.Find(What:=myWords(iCtr), _
    After:=.Cells(.Cells.Count), _
    LookIn:=xlValues, _
    lookat:=xlPart, _
    searchorder:=xlByRows, _
    searchdirection:=xlNext, _
    MatchCase:=False)
    If FoundCell Is Nothing Then
    Exit Do
    Else
    FoundCell.EntireRow.Delete
    End If
    Loop
    Next iCtr
    End With
    End With
    
    
    
    
    Dim FoundCell As Range
    Dim myWords As Variant
    Dim wks As Worksheet
    Dim iCtr As Long
    
    myWords = Array("IBM Global Services", "Printing Systems", "STG", "TotalStorage")
    Set wks = ActiveSheet
    With wks
    With .Range("D:D")
    For iCtr = LBound(myWords) To UBound(myWords)
    Do
    Set FoundCell = .Cells.Find(What:=myWords(iCtr), _
    After:=.Cells(.Cells.Count), _
    LookIn:=xlValues, _
    lookat:=xlPart, _
    searchorder:=xlByRows, _
    searchdirection:=xlNext, _
    MatchCase:=False)
    If FoundCell Is Nothing Then
    Exit Do
    Else
    FoundCell.EntireRow.Delete
    End If
    Loop
    Next iCtr
    End With
    End With
    
    
    
    
    Dim FoundCell As Range
    Dim myWords As Variant
    Dim wks As Worksheet
    Dim iCtr As Long
    
    myWords = Array("Closed", "Canceled", "Requested")
    Set wks = ActiveSheet
    With wks
    With .Range("F:F")
    For iCtr = LBound(myWords) To UBound(myWords)
    Do
    Set FoundCell = .Cells.Find(What:=myWords(iCtr), _
    After:=.Cells(.Cells.Count), _
    LookIn:=xlValues, _
    lookat:=xlPart, _
    searchorder:=xlByRows, _
    searchdirection:=xlNext, _
    MatchCase:=False)
    If FoundCell Is Nothing Then
    Exit Do
    Else
    FoundCell.EntireRow.Delete
    End If
    Loop
    Next iCtr
    End With
    End With
    
    
    
    Dim RW As Long, LR As Long
    
    LR = Range("P" & Rows.Count).End(xlUp).Row
    
    For RW = 2 To LR
        Select Case Range("P" & RW).Value
            Case "Enroll"
                Range("G" & RW).Value = "OPEN POT"
            Case "Nominate"
                Range("G" & RW).Value = "OPEN POT"
        End Select
    Next RW
    
    End Sub

    I've also tried this method, but this isn't working either.

    Sub One()
        Call DeleteInternalMeetings
        Call ShowSoftwareBrands
        Call ShowConfirmedStatus
        Call OPENPOT
    End Sub
    Thanks in advance!
    Last edited by Cutter; 08-09-2012 at 12:27 PM. Reason: Corrected title

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