|
-
Jun 30th, 2005, 03:28 AM
#1
Thread Starter
New Member
Form Freezing, with spreadsheet component
Hello
I use two spreedsheets in my vb program , and ervery form includes 3000 rows
and there are two loops workin with the two speedshets,
When i start the loop , the application freez , is there anyway to solve this??
the program need about 2-3 hours the get the result.
this is the code:
Dim colcount As Integer
Dim rowcount As Integer
Dim colc As Integer
Dim rowc As Integer
Dim temp As Integer
Private Sub Command1_Click()
Command1.Enabled = False
colcount = 2
rowcount = 1
colc = 2
rowc = 1
Text1.Text = newsheet.Cells(rowcount, 2).Value
Do
Do While old.Cells(rowc, colc).Value <> ""
If newsheet.Cells(rowcount, 2).Value = old.Cells(rowc, 2).Value And newsheet.Cells(rowcount, 4).Value = old.Cells(rowc, 4).Value Then
newsheet.Cells(rowcount, 9).Value = old.Cells(rowc, 9).Value
newsheet.Cells(rowcount, 10).Value = old.Cells(rowc, 10).Value
newsheet.Cells(rowcount, 11).Value = old.Cells(rowc, 11).Value
newsheet.Cells(rowcount, 12).Value = old.Cells(rowc, 12).Value
newsheet.Cells(rowcount, 13).Value = old.Cells(rowc, 13).Value
newsheet.Cells(rowcount, 14).Value = old.Cells(rowc, 14).Value
'temp = rowc
Exit Do
Form1.Refresh
End If
rowc = rowc + 1
Loop
rowc = 1
rowcount = rowcount + 1
Form1.Refresh
Loop While newsheet.Cells(rowcount, colcount).Value <> ""
Command1.Enabled = True
End Sub
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|