Go Back   TechArena Community > Software > Software Development
Become a Member!
Forgot your username/password?
Register Tags Active Topics RSS Search Mark Forums Read SiteMap

Tags: ,

Sponsored Links



Pascal exercises

Software Development


Reply
 
Thread Tools Search this Thread
  #1  
Old 07-10-2008
Member
 
Join Date: Oct 2008
Posts: 79
Pascal exercises

Hi
I want to see something that can very easily .. But do not sack .. I have a macro that I print to the screen or write to in column A, the number:

000000001 to 100000000

Code:
Bone: 

A 

000000001 
000000002 
000000003 
000000004 



099999998 
099999999 
100000000
Greetings!!
Reply With Quote
  #2  
Old 07-10-2008
Zecho's Avatar
Member
 
Join Date: May 2008
Posts: 2,267
If you could give me a greater idea of what you need. Or if it is necessary to create a macro. To get started you can select the column to list and put text format, in the row of a column where you want to start list and put the first value eg "00000001" and then select the column. You edit aa / fill / series autorun increase in one, accept and logically if you are ready to fill the last row depends on the version of Excel, if you want to record a macro and whatever changes you do, the variables remain constant.
Reply With Quote
  #3  
Old 07-10-2008
Member
 
Join Date: Oct 2008
Posts: 79
Hi thanks for your answer!! I have a new query.

I have this code:
Code:
Sub numbers () 
Dim wMax As Long 'number of cells to fill 
As Long Dim wFil 'current row 
As Long Dim wCol 'current column 
As Long Dim WCON "counting of cells filled 
Dim wTiE As Double 'time (in hours) 
Dim wTiI As Double 'initial time (in seconds) 
Dim wTiF As Double 'final time (in seconds) 
Dim wTiT As Double 'total time (in seconds) 
As String Dim wCoT 'Contador in text format 
WMsg As String Dim 'final message of time 

wMax = 100000000 
WCON = 0 
wCoT = "" 
wFil = 1 
wCol = 1 
wTiI = Timer 
For WCON = 1 To wMax 
wCoT = Format (WCON, "000000000") 
Range (Cells (wFil, wCol), Cells (wFil, wCol)) = " '" & wCoT 
Then if wFil = 60000 
wFil = 1 
wCol = wCol + 1 
Else 
wFil = wFil + 1 
End If 
Next 
wTiF = Timer 
wTiT = wTiF - wTiI 

wTiE = ((100000000 / 60 / 60) * wTiT) / wMax 
wMsg = "To" wMax & & "records has been slow" wTiT & & "seconds" & Chr (10) & _ 
"To take 100000000" wTiE & & "Hours" 
MsgBox wMsg 
End Sub
The problem is that it reaches the column IV and ends there .. and missing numbers. My question is, can I continue to the next path? Example, the path 1 end follows in the path 2.

Greetings!
Reply With Quote
  #4  
Old 07-10-2008
MindSpace's Avatar
Member
 
Join Date: Feb 2008
Posts: 1,832
Amending this part of the code, I think it should be run with it. Be sure to take the necessary quantity of leaves in the book candidates = (number of times) / (limit files * limite columns)

Code:
Then if wFil = 60000 
If wCol = 256 Then'256 is the limit of columns in Excel 2003 
Sheets (ActiveSheet.Index + 1). Activate 
wCol = 1 
Else 
wCol = wCol + 1 
End If 
wFil = 1 
Else 
wFil = wFil + 1 
End If
Reply With Quote
  #5  
Old 07-10-2008
Zecho's Avatar
Member
 
Join Date: May 2008
Posts: 2,267
If you do not know in advance:
a) the number of rows
b) the number of columns
c) the quantity of leaves

Follow these steps:
Code:
which is supposed to start the sheet is blank, no details. 
'Here I tell VBA that from cell A1, go to the end (end), down' (xlDown) and I return the nro row. I do the same thing towards the end and to the right 
'to determine the number of existing columns: 
TotalFilas = Cells (1,1). End (xlDown). Row 
TotalColumnas = Cells (1,1). End (xlRigth). Column 
'or a much easier: 
TotalFilas = ActiveSheet.Rows.Count 
TotalColumnas = ActiveSheet.Columns.Count 
'to the total leaf from the book: 
TotalHojas = ActiveWorkbook.Sheets.Count
next you're driving the leaves and if necessary, add sheets
Reply With Quote
Reply

  TechArena Community > Software > Software Development


Thread Tools Search this Thread
Search this Thread:

Advanced Search


Similar Threads for: "Pascal exercises"
Thread Thread Starter Forum Replies Last Post
How to write program to generate a pascal triangle in java? Aandaleeb Software Development 7 11-09-2011 01:37 PM
C# exercises puk284 Software Development 2 03-02-2009 08:12 AM
Pascal language for beginners Abaan Software Development 3 07-01-2009 01:21 PM


All times are GMT +5.5. The time now is 11:14 AM.