G
Glenda
I have some code that sections off like pieces of data and then adds a total
to the cell to the right one column and down 1 row from the last row of data.
When it hits the first empty line of the spreadsheet I'm getting a run time
error 13 type mismatch error. I'm new to code in excel and salvaged this
from code done by a predecessor. I'm not sure how to fix the problem.
Dim QtyTot As Integer
Range("C5").Select
Columns("c").NumberFormat = "0"
Do
QtyTot = 0
Do
QtyTot = ActiveCell.Value + QtyTot
Selection.Offset(1, 0).Select
If IsEmpty(ActiveCell) Then Exit Do
Loop
Selection.Offset(-0, 1).Select
ActiveCell.Value = QtyTot
Selection.Offset(1, -1).Select
If IsEmpty(ActiveCell) Then Exit Do
Loop
Range("a1").Select
Calculate
to the cell to the right one column and down 1 row from the last row of data.
When it hits the first empty line of the spreadsheet I'm getting a run time
error 13 type mismatch error. I'm new to code in excel and salvaged this
from code done by a predecessor. I'm not sure how to fix the problem.
Dim QtyTot As Integer
Range("C5").Select
Columns("c").NumberFormat = "0"
Do
QtyTot = 0
Do
QtyTot = ActiveCell.Value + QtyTot
Selection.Offset(1, 0).Select
If IsEmpty(ActiveCell) Then Exit Do
Loop
Selection.Offset(-0, 1).Select
ActiveCell.Value = QtyTot
Selection.Offset(1, -1).Select
If IsEmpty(ActiveCell) Then Exit Do
Loop
Range("a1").Select
Calculate