+ Reply to Thread
Results 1 to 2 of 2

Out of Space in coloum

  1. #1
    Pete
    Guest

    Out of Space in coloum

    I have this bit of code that I use and it seams to run without any trouble
    until it max's out the coloum that I start in.

    What I want it to do is when the code reaches lest say row 25000 I want it
    to move over to the next coloum and pick up where it left off in the previous.

    I just can't seam to figure ii out.

    Application.ScreenUpdating = False
    Sheets("Sheet1").Select
    Range("A1").Select

    For card1 = 1 To 30
    For card2 = 2 To 30
    For card3 = 3 To 30
    If Not (card1 = card2 And card2 = card3) Then
    ActiveCell = card1 & "-" & card2 & "-" & card3
    ActiveCell.Offset(1, 0).Select
    End If
    Next card3
    Next card2
    Next card1

    TIA
    --
    Pete

  2. #2
    Toppers
    Guest

    RE: Out of Space in coloum

    Pete,

    Try this - it moves to next column on 20001st entry .. change as required

    HTH

    Sub Macro1()
    Application.ScreenUpdating = False
    Sheets("Sheet1").Select
    Range("A1").Select

    For card1 = 1 To 30
    For card2 = 2 To 30
    For card3 = 3 To 30
    If Not (card1 = card2 And card2 = card3) Then
    ActiveCell = card1 & "-" & card2 & "-" & card3
    ActiveCell.Offset(1, 0).Select
    If ActiveCell.Row = 20001 Then Cells(1, ActiveCell.Column + 1).Select
    End If
    Next card3
    Next card2
    Next card1


    End Sub

    "Pete" wrote:

    > I have this bit of code that I use and it seams to run without any trouble
    > until it max's out the coloum that I start in.
    >
    > What I want it to do is when the code reaches lest say row 25000 I want it
    > to move over to the next coloum and pick up where it left off in the previous.
    >
    > I just can't seam to figure ii out.
    >
    > Application.ScreenUpdating = False
    > Sheets("Sheet1").Select
    > Range("A1").Select
    >
    > For card1 = 1 To 30
    > For card2 = 2 To 30
    > For card3 = 3 To 30
    > If Not (card1 = card2 And card2 = card3) Then
    > ActiveCell = card1 & "-" & card2 & "-" & card3
    > ActiveCell.Offset(1, 0).Select
    > End If
    > Next card3
    > Next card2
    > Next card1
    >
    > TIA
    > --
    > Pete


+ 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