+ Reply to Thread
Results 1 to 3 of 3

Loop VBA Macro

  1. #1
    Registered User
    Join Date
    06-02-2015
    Location
    México
    MS-Off Ver
    2010
    Posts
    7

    Loop VBA Macro

    Hi guys, i need your help, im trying the next code but i can´t pass to the next sheet.... i missing somethig.. SOS... je



    Option Explicit

    Sub CHFC()

    Dim wb As Workbook
    Dim ws_count As Long
    Dim I As Long

    Set wb = ActiveWorkbook
    ws_count = wb.Worksheets.Count

    For I = 1 To ws_count

    Rows("42:58").Select
    Selection.Rows.Group
    Rows("60:63").Select
    Selection.Rows.Group
    Rows("65:78").Select
    Selection.Rows.Group
    Rows("80:83").Select
    Selection.Rows.Group
    Rows("85:86").Select
    Selection.Rows.Group
    Rows("89:96").Select
    Selection.Rows.Group
    Rows("98:104").Select
    Selection.Rows.Group
    Rows("106:108").Select
    Selection.Rows.Group
    Rows("110:121").Select
    Selection.Rows.Group
    Rows("123:125").Select
    Selection.Rows.Group
    Rows("127:130").Select
    Selection.Rows.Group
    Rows("132:134").Select
    Selection.Rows.Group
    Rows("138:142").Select
    Selection.Rows.Group
    Rows("144:145").Select
    Selection.Rows.Group
    Rows("147:148").Select
    Selection.Rows.Group
    Rows("153:157").Select
    Selection.Rows.Group
    Rows("160:167").Select
    Selection.Rows.Group
    Rows("169:174").Select
    Selection.Rows.Group
    Rows("88:167").Select
    Selection.Rows.Group
    ActiveSheet.Outline.ShowLevels RowLevels:=3
    ActiveSheet.Outline.ShowLevels RowLevels:=2
    ActiveSheet.Outline.ShowLevels RowLevels:=1
    Range("A41").Select


    Next I

    End Sub

  2. #2
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,643

    Re: Loop VBA Macro

    Try this...

    Please Login or Register  to view this content.
    Surround your VBA code with CODE tags e.g.;
    [CODE]your VBA code here[/CODE]
    The # button in the forum editor will apply CODE tags around your selected text.

  3. #3
    Registered User
    Join Date
    06-02-2015
    Location
    México
    MS-Off Ver
    2010
    Posts
    7

    Re: Loop VBA Macro

    Thak u men.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. loop macro - copy, paste, run macro
    By icestorm in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-01-2015, 09:16 AM
  2. Replies: 3
    Last Post: 01-07-2015, 12:19 PM
  3. [SOLVED] Have a loop macro loop for all visible worksheets
    By Graeme-Black in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 08-22-2014, 11:01 AM
  4. Novice with VBA and macro writing needing help to loop a macro unti no data
    By jrongone in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 07-25-2013, 12:19 PM
  5. [SOLVED] Copy dynamically changing column and Paste using VBA Loop (Loop within Loop)
    By nixon72 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 02-12-2013, 12:46 PM
  6. Macro to delete rows with a Zero value. Macro seems to be in continual loop
    By jnorri in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 08-07-2012, 03:20 PM
  7. Macro Loop Broken. Detects Max but doesn't continue loop
    By herchenbach in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-21-2011, 12:17 PM

Tags for this Thread

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