I am making a form and I want the person to only register 6x (only 6 lines) the content. How to limit this amount?
Asaboveexample,IputtherowsandcolumnsandwhenIfilltheform,newnumbersaregoingdown
PrivateSubCmdSalvar_Click()DimLinhaAsInteger'ValorinicialdaVariávelLinhaLinha=85**DoUntilThisWorkbook.Sheets("CADASTRO").Cells(Linha, 8).Value = Empty
Linha = Linha + 1**
Loop
'SE o usuário não entrar com os dados
If TxtMes.Value = Empty Or TxtAno.Value = Empty Then
ElseIf TxtLeitura.Value = Empty Or TxtConsumo.Value = Empty Then
MsgBox ("Preencha todos os dados!")
Else
ThisWorkbook.Sheets("CADASTRO").Cells(Linha, 8).Value = TxtMes.Value
ThisWorkbook.Sheets("CADASTRO").Cells(Linha, 9).Value = TxtAno.Value
ThisWorkbook.Sheets("CADASTRO").Cells(Linha, 11).Value = TxtLeitura.Value
ThisWorkbook.Sheets("CADASTRO").Cells(Linha, 14).Value = TxtConsumo.Value
End If
End Sub
I think it's because of the following lines:
**Do Until ThisWorkbook.Sheets("CADASTRO").Cells(Linha, 8).Value = Empty
Linha = Linha + 1**
But how do I change to stop the fill in line 90? (It starts at line 85 and I want to stop at 90)