muhittinemmi
New Member
- Joined
- Jun 20, 2023
- Messages
- 19
VBA Code:
Private Sub CommandButton8_Click()
Dim emmi As Long, Say As Byte
emmi = Range(Range("I2").Value).End(3).Row + 1
If Cells(emmi, "a").Value <> "" Then
MsgBox "There must be at least 3 lines of space ", vbInformation, "Teklif"
Exit Sub
End If
Cells(emmi, "A").Value = "Satır 1"
Cells(emmi + 1, "A").Value = "Satır 5"
Cells(emmi + 2, "A").Value = "Satır 3"
End Sub
When I click the button, I add 3 lines of information
When I click the button, if all lines are filled, I get a warning that there must be at least 3 lines of space before I can add.
The "I2" content shows the last line.
Example: If 2 lines are empty, when I click the button, 2 lines of information are added " Cells(emmi, "A").Value = "Line 1"
and Cells(emmi + 1, "A").Value = "Line 5" " 3rd line is missing
If 1 or 2 lines of space are left when the button is clicked, how can I give the warning "There must be at least 3 lines of space" without adding anything?
Last edited: