+ Reply to Thread
Results 1 to 25 of 25

Make recorded macro loop

Hybrid View

  1. #1
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,167

    Re: Make recorded macro loop

    It will be good if you explain what your code is trying to do. Sometimes while recording the macro, if you click on the wrong cell(s), it still includes it and this will not help us in editing the code for you.
    If I have helped, Don't forget to add to my reputation (click on the star below the post)
    Don't forget to mark threads as "Solved" (Thread Tools->Mark thread as Solved)
    Use code tags when posting your VBA code: [code] Your code here [/code]

  2. #2
    Registered User
    Join Date
    06-22-2005
    Posts
    19

    Re: Make recorded macro loop

    Quote Originally Posted by arlu1201 View Post
    It will be good if you explain what your code is trying to do. Sometimes while recording the macro, if you click on the wrong cell(s), it still includes it and this will not help us in editing the code for you.
    Well it's a little hard to say but I'm converting columns to rows. Example column E has a header row and then below that are several fees. I'm moving the fees into column b and then in column C I'm copying the header row for all the fees for that column and the next columns goes right beneth the prior column in the rows. The current macro is working great but I just don't know how to get it to keeping going to the next column until they have all been converted to rows.

  3. #3
    Registered User
    Join Date
    06-22-2005
    Posts
    19

    Re: Make recorded macro loop

    Quote Originally Posted by cowannbell View Post
    Well it's a little hard to say but I'm converting columns to rows. Example column E has a header row and then below that are several fees. I'm moving the fees into column b and then in column C I'm copying the header row for all the fees for that column and the next columns goes right beneth the prior column in the rows. The current macro is working great but I just don't know how to get it to keeping going to the next column until they have all been converted to rows.
    Sub ARS2013test()
    '
    ' ARS2013test Macro
    '
    ' Keyboard Shortcut: Ctrl+t
    '
        ActiveCell.Offset(0, 1).Range("A1").Select
        Range(Selection, Selection.End(xlDown)).Select
        Selection.Cut
        ActiveCell.Offset(0, -3).Range("A1").Select
        Selection.End(xlDown).Select
        ActiveCell.Offset(1, 0).Range("A1").Select
        ActiveSheet.Paste
        Selection.End(xlUp).Select
        ActiveCell.Offset(-1, 0).Range("A1").Select
        Selection.End(xlToRight).Select
        Selection.Copy
        ActiveCell.Offset(1, -2).Range("A1").Select
        Selection.End(xlDown).Select
        ActiveCell.Offset(1, 0).Range("A1:A31").Select
        Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
            :=False, Transpose:=False
        Selection.End(xlUp).Select
        ActiveCell.Offset(0, 2).Columns("A:A").EntireColumn.Select
        Application.CutCopyMode = False
        Selection.Delete Shift:=xlToLeft
        ActiveCell.Offset(1, -1).Range("A1").Select
    End Sub

+ Reply to Thread

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