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

Workdays for a market open Mon, Wed, Friday?
Yes! Use "0101011" for the weekend argument in NETWORKDAYS.INTL or WORKDAY.INTL. The 7 digits start on Monday. 1 means it is a weekend.
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,223,958
Messages
6,175,629
Members
452,661
Latest member
Nonhle

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