if else function

dshafique

Board Regular
Joined
Jun 19, 2017
Messages
171
Hi guys, not too good with if else loops and was looking for a little help. Im trying to run a macro where it checks if the cell below the current one is empty. If so, then delete everything from below that cell. otherwise do nothing


Code:
If ActiveCell.Value <> "" Then
        ActiveCell.Offset(1).Select
        Range(ActiveCell, Cells(ActiveCell.End(xlDown).Row, ActiveCell.End(xlToRight).Column)).Select
        Selection.EntireRow.Delete
    ElseIf ActiveCell.Offset(Is Notempty) Then
        do nothing
       
    End If
 

Excel Facts

Bring active cell back into view
Start at A1 and select to A9999 while writing a formula, you can't see A1 anymore. Press Ctrl+Backspace to bring active cell into view.
Can you post the code for the loop?

PS When deleting it's always best to loop 'backwards'/'bottom to top'.
 
Upvote 0
this is basically the code, I forgot to save, and forgot what what was in the else if's body. but this is basically the pseudo code of what it should do
 
Upvote 0

Forum statistics

Threads
1,216,671
Messages
6,132,042
Members
449,697
Latest member
bororob85

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top