+ Reply to Thread
Results 1 to 3 of 3

Macro to repeat action too a range of cells with assending numbers in the cells.

  1. #1
    Registered User
    Join Date
    01-06-2010
    Location
    Washington, DC
    MS-Off Ver
    Excel 2010
    Posts
    53

    Macro to repeat action too a range of cells with assending numbers in the cells.

    No sure how to word what I am trying to do.
    but I have a LARGE sheet where I need a group of cells with the same data to be merged...

    Dim lngRow As Long
    Dim LookUpRow As String

    For lngRow = 7 To 1350

    ' select 12 cells to perform the task each set of 12 cells contain the year 1901, 1902, 1903....

    Range("A7:A18").Select ' 1900 Group of 12 cells in column
    With Selection ' Macro task to perform on the Cells
    .HorizontalAlignment = xlCenter
    .VerticalAlignment = xlCenter
    .WrapText = False
    .Orientation = 90
    .AddIndent = False
    .IndentLevel = 0
    .ShrinkToFit = False
    .ReadingOrder = xlContext
    .MergeCells = True
    End With

    LookUpRow = Cells(lngRow, 12).Value ' sort of lost on how to repeat the maco of the next set of 12 cells in column A

    Next

    End Sub

    Any Ideas....

  2. #2
    Forum Contributor
    Join Date
    03-15-2007
    Location
    AL, USA
    MS-Off Ver
    2007
    Posts
    174

    Re: Macro to repeat action too a range of cells with assending numbers in the cells.

    Quote Originally Posted by 2k05gt View Post
    No sure how to word what I am trying to do.
    but I have a LARGE sheet where I need a group of cells with the same data to be merged...

    Please Login or Register  to view this content.
    Any Ideas....
    Try this:
    Please Login or Register  to view this content.

  3. #3
    Registered User
    Join Date
    01-06-2010
    Location
    Washington, DC
    MS-Off Ver
    Excel 2010
    Posts
    53

    Re: Macro to repeat action too a range of cells with assending numbers in the cells.

    Thanks that did it..

+ 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