Results 1 to 5 of 5

Thread: Run Macro one after the other

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #2
    Fuhrer, Vierte Reich DocAElstein's Avatar
    Join Date
    Aug 2014
    Posts
    9,521
    Rep Power
    10
    Hi msiyab,
    I do not really understand most of your post…



    Quote Originally Posted by msiyab View Post
    .... When I run the macro, ...
    What macro are you talking about??



    Quote Originally Posted by msiyab View Post
    ...When I run the macro, before one process is finished the second one start which does not give the desired result.
    I want it to pause till the previous Sub is complete and then run the next line of commands.....
    I don’t understand. That does not really make any sense. You are explaining very badly.



    I think you need to try to explain everything again.



    What is the problem in doing this?
    Code:
    Sub CallEmAll()
     Call UnmergeAllCells
     Call UnWrapTextAllCells
     Call PasteSpecial_ValuesOnly
     Call RowAndColumnAutoFit
     Call deleteMultipleRows
     Call DeleteColumns
    End Sub


    What is the problem in doing this?
    Code:
    Sub DoItAll()
    'Sub UnmergeAllCells()
     ActiveSheet.Cells.UnMerge
    'End Sub
    'Sub UnWrapTextAllCells()
     Cells.WrapText = False
    'End Sub
    'Sub PasteSpecial_ValuesOnly()
    'Copy A Range of Data
     Worksheets("Sheet1").Range("S2").Copy
    'PasteSpecial Values Only
     Worksheets("Sheet2").Range("T2").PasteSpecial Paste:=xlPasteValues
    'Clear Clipboard (removes "marching ants" around your original data set)
     Application.CutCopyMode = False
    'End Sub
    'Sub RowAndColumnAutoFit()
     Worksheets("Sheet1").Columns("A:BF").AutoFit
    'End Sub
    'Sub deleteMultipleRows()
     Rows("3:6").Delete
    'End Sub
    'Sub DeleteColumns()
     Worksheets("Sheet1").Range("A:C,E:F,H:J,L:S,U:X,Z:AB,AD:AH,AJ:BF").EntireColumn.Delete
    'End Sub
    End Sub







    Alan
    Last edited by DocAElstein; 10-22-2020 at 03:37 PM.

Similar Threads

  1. Replies: 6
    Last Post: 09-03-2019, 10:26 AM
  2. Macro to Auto Run When Excel Cell Data Changes
    By vwallace in forum Excel Help
    Replies: 5
    Last Post: 11-05-2014, 11:04 PM
  3. Selecting workbook to run macro
    By Rajesh Kr Joshi in forum Excel Help
    Replies: 2
    Last Post: 08-24-2012, 08:21 PM
  4. Click Run cycle
    By PcMax in forum Excel Help
    Replies: 6
    Last Post: 11-01-2011, 04:50 AM

Posting Permissions

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