Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 193
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,339
Default 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
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
how can i group coloum yaseen New Users to Excel 2 June 2nd 10 08:02 AM
Formula in a coloum franco monte New Users to Excel 8 March 7th 10 07:25 PM
Delete coloum in VB haviv Excel Discussion (Misc queries) 3 September 12th 08 09:29 AM
how to change coloum to row sangeet Excel Worksheet Functions 5 June 4th 07 04:13 PM
Regonise coloum A while adding up coloum B to give a result in C B.H.JIG Excel Discussion (Misc queries) 3 May 3rd 07 01:25 PM


All times are GMT +1. The time now is 08:01 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"