Error Checking in Excel
Thanks Thanks:  0
Likes Likes:  0
Results 1 to 2 of 2

Thread: How do I get a macro to...

  1. #1
    MrExcel MVP
    Join Date
    Feb 2002
    Location
    Sydney, Australia
    Posts
    2,940
    Post Thanks / Like
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    Default

    You could put it in a loop like this:-


    Code:
    Sub DoItToAllSheets()
    Dim sht As Worksheet
    
    For Each sht In ThisWorkbook.Worksheets
        'Do something to the sheet
        sht.Cells.Columns.AutoFit
    Next
    
    End Sub
    You don't say whether you're activating things (e.g. Range("A1").Select) or not so this code may not be appropriate. It's normally helpful if you post some or all of your code.

    HTH,

    D

  2. #2
    Board Regular
    Join Date
    Feb 2002
    Location
    Where the wild roses grow
    Posts
    285
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default


    Sorry, I just wanted a macro that would run all the macro formulas in a workbook. They all format the info that's been pasted in each one to a presentable level

    It's OK though, I got it

    Thanks for your suggestion though

Some videos you may like

User Tag List

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

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