|
| |||||||||
| Tags: exercises, pascal |
![]() |
| | Thread Tools | Search this Thread |
|
#1
| |||
| |||
| 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 |
|
#2
| ||||
| ||||
|
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. |
|
#3
| |||
| |||
|
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 Greetings! |
|
#4
| ||||
| ||||
|
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 |
|
#5
| ||||
| ||||
|
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 |
![]() |
|
| Thread Tools | Search this Thread |
| |
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 |