delete rows

james potter

New Member
Joined
Aug 15, 2005
Messages
45
I working on a little project but can not find a solution for a small problem.
I tried but did not succeed. So could anyone assist my?

I have a table with data, for instance, from A1 to F9, this range can change in size due to data import. The last two lines start with their data in column B. I want those rows to be deleted if they have data in column B and not in column A. I know how to code to go to the last edit cell in column A and one down. But I do not know how to make the row variabel in my code. Was the code for this part?

An other project I am working is almost the same but not with the B column part. I just want to go to the last edit cell in column A and every row under that cell can be deleted. Was it the code for this part?

Thanks sofar
 

Excel Facts

Enter current date or time
Ctrl+: enters current time. Ctrl+; enters current date. Use Ctrl+: Ctrl+; Enter for current date & time.
The Range object's EntireRow property will return the entire row for that Range. Then you can use the Delete method. Example:

Range("A1").End(xlDown).Offset(1, 0).EntireRow.Delete
 
Upvote 0

Forum statistics

Threads
1,215,028
Messages
6,122,753
Members
449,094
Latest member
dsharae57

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