Want delete rows if A have value and O not

K

Kari

Hello!
Can somebody help me with this. Here is how much I have done.
t. Kari

Sub deleteemptyrows()
Do
Set tamarivi = Rows("2:2")
Set solu1 = Range("A2")
Set solu2 = Range("O2")
Rows("2:2").Select
If Not solu1 = Empty And solu2 = Empty Then
MsgBox "A2 sisältää arvon ja O2 ei", vbOKOnly, "Poista rivi"
tamarivi.EntireRow.Delete
Set tamarivi = Rows("2:2")
Set solu1 = Range("A2")
Set solu2 = Range("O2")
Else
If IsEmpty(solu1) And IsEmpty(solu2) Then
MsgBox "A2 ja O2 on tyhjiä", vbOKOnly, "Lopeta ohjelma"
Exit Sub
Else
If Not solu1 = Empty Or solu2 = Empty Then
MsgBox "A2 ja O2 sisältää kumpikin arvon", vbOKOnly, "Jatka ohjelmaa"
Set seurrivi = tamarivi.Offset(1, 0)
End If
End If
End If
Loop Until solu1 = Empty
End Sub
 
K

Kari

Sorry my bad english. Yor code works thank you but I need script that delete
other rows but those who have in same time value in A and O.
Regards Kari
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top