| | |
Do while loop
Please support our Visual Basic 4 / 5 / 6 advertiser: Programming Forums - DaniWeb Sister Site
Thread Solved |
There r so many ways to loop.
Try this one.
Hope this solves ur problem.
Regards
Shaik Akthar
Try this one.
Visual Basic 4 / 5 / 6 Syntax (Toggle Plain Text)
Dim colVar As Integer Dim colChars As String Dim cellAdd As String colChars = "ABCDEFGHIJKLMNOPQRSTUVWXYZ" For colVar = 1 To 4 cellAdd = Mid(colChars, colVar, 1) & 1 Range(cellAdd).Value = colVar Next colVar
Hope this solves ur problem.
Regards
Shaik Akthar
Visual Basic 4 / 5 / 6 Syntax (Toggle Plain Text)
Dim colVar As Integer Dim noOfCols As Integer Dim colChars As String Dim cellAdd As String colChars = "ABCDEFGHIJKLMNOPQRSTUVWXYZ" 'This piece of code holds good 'for Columns upto 26 only 'Because beyond that the col names will 'be AA, AB, AC,... 'Then u may have to create and array 'using a loop to store the column names noOfCols = 10 For colVar = 1 To noOfCols cellAdd = Mid(colChars, colVar, 1) & 1 Range(cellAdd).Value = noOfCols - colVar + 1 Next colVar
Hope this solves ur problem.
Regards
Shaik Akthar
Last edited by aktharshaik; Aug 17th, 2008 at 1:23 pm.
U have to take another Variable
Regards
Shaik Akthar
Visual Basic 4 / 5 / 6 Syntax (Toggle Plain Text)
I = 1 N = 5 Do While I < N Cells(1,I) = N - I I = I + 1 Loop
Regards
Shaik Akthar
![]() |
Similar Threads
- Help with gui loop. (C)
- Loop...without the loop (Java)
Other Threads in the Visual Basic 4 / 5 / 6 Forum
- Previous Thread: Using search command in the database. . .help
- Next Thread: is this the correct answer??
| Thread Tools | Search this Thread |
* 6 429 2007 access activex add age append application basic beginner birth bmp calculator cd cells.find click client code college column component connection connectionproblemusingvb6usingoledb copy creat ctrl+f data database datareport date delete dissertations dissertationthesis dissertationtopic edit error excel excelmacro file filename form hardware header iamthwee image inboxinvb internetfiledownload keypress label listbox listview liveperson login looping machine microsoft movingranges number objectinsert open oracle password prime program prompt range-objects readfile reading record refresh remotesqlserverdatabase report retrieve save search sendbyte sites sort sql sql2008 sqlserver subroutine table tags textbox time timer urldownloadtofile vb vb6 vb6.0 vba visual visualbasic visualbasic6 web window windows



1 with the numbers 4 to 1 respectively. can anyone help?? 

