Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I have an small program with a bug in the second pass to print a spread
sheet, it does the fisrt time without no problems, but the second time, doesn't work anymore. NEED HELP.. Private Sub CommandButton1_Click() ans = MsgBox("Do you want to print faxes?", vbYesNo) If ans = vbNo Then Exit Sub End If Dim col As Integer Dim row As Integer Dim counter As Integer Dim I As Integer col = 2 row = 2 counter = 1 For row = row To 20 If Sheet8.Cells(row, counter) = "" Then Exit Sub Else Sheet1.Cells(3, 7) = Sheet8.Cells(row, counter) counter = counter + 1 Sheet1.Cells(5, 3) = Sheet8.Cells(row, counter) counter = counter + 1 Sheet1.Cells(5, 6) = Sheet8.Cells(row, counter) counter = counter + 1 Sheet1.Cells(5, 9) = Sheet8.Cells(row, counter) counter = counter + 1 Sheet1.Cells(5, 12) = Sheet8.Cells(row, counter) counter = counter + 1 counter = 1 Sheet1.PrintOut Sheet8.Cells(row, 5) = "PRINTED" For I = I To 300 Next I I = 0 End If Next row End Sub Private Sub CommandButton2_Click() Dim row1 As Integer Dim count As Integer row1 = 2 count = 1 For row1 = row1 To 30 For count = count To 5 Sheet8.Cells(row1, count) = "" Next count count = 1 Next row1 End Sub |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Clicking Commandbutton2 clears all the values out of Sheet8, rows 2 to 30
the first test in CommandButton1 is If Sheet8.Cells(row, counter) = "" Then Exit Sub Else so it quites on the first empty cell in Sheet8 in A2:A20 Possible that you have empty cells in column 1 of sheet8? -- Regards, Tom Ogilvy "Fernando Duran" wrote: I have an small program with a bug in the second pass to print a spread sheet, it does the fisrt time without no problems, but the second time, doesn't work anymore. NEED HELP.. Private Sub CommandButton1_Click() ans = MsgBox("Do you want to print faxes?", vbYesNo) If ans = vbNo Then Exit Sub End If Dim col As Integer Dim row As Integer Dim counter As Integer Dim I As Integer col = 2 row = 2 counter = 1 For row = row To 20 If Sheet8.Cells(row, counter) = "" Then Exit Sub Else Sheet1.Cells(3, 7) = Sheet8.Cells(row, counter) counter = counter + 1 Sheet1.Cells(5, 3) = Sheet8.Cells(row, counter) counter = counter + 1 Sheet1.Cells(5, 6) = Sheet8.Cells(row, counter) counter = counter + 1 Sheet1.Cells(5, 9) = Sheet8.Cells(row, counter) counter = counter + 1 Sheet1.Cells(5, 12) = Sheet8.Cells(row, counter) counter = counter + 1 counter = 1 Sheet1.PrintOut Sheet8.Cells(row, 5) = "PRINTED" For I = I To 300 Next I I = 0 End If Next row End Sub Private Sub CommandButton2_Click() Dim row1 As Integer Dim count As Integer row1 = 2 count = 1 For row1 = row1 To 30 For count = count To 5 Sheet8.Cells(row1, count) = "" Next count count = 1 Next row1 End Sub |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Is there a way to unload the loaded XLL file in Excel? Hi all, I amdebugging XLL link library using Visual C++. Everytime I rebuild the XLL, Ihave to close the whole Excel program and relaunch the Excel program again,and then load in the newly gene | Excel Discussion (Misc queries) | |||
Help with Program | Excel Worksheet Functions | |||
Which program? | Excel Discussion (Misc queries) | |||
merging excel program with tdc finance program | Excel Programming | |||
run program | Excel Programming |