Delete cell content based on adjacent cell value

Anarki

New Member
Joined
Oct 9, 2006
Messages
5
Hi Guys

I am trying to create some code for a mcaro but lack the knowledge to put it all together

I have column B filled with a name in each cell
I have column C filled with a number adjacent to each name in column B (Not all names have data in the adjacent cell)

I need to delete the data from each cell in column B if its adjacent cell in column C is blank

Any ideas how i can put this together?

Your help is greatly appreciated

Thanks,
Mick
 

Excel Facts

Return population for a City
If you have a list of cities in A2:A100, use Data, Geography. Then =A2.Population and copy down.
L

Legacy 68403

Guest
try the following code

Code:
Range("B1").Select
Do While Not IsEmpty(ActiveCell)
Do While Not IsEmpty(ActiveCell)
ActiveCell.Offset(1, 0).Select
Loop
ActiveCell.EntireRow.Select
Selection.Delete Shift:=xlUp
ActiveCell.Offset(0, 1).Select
Loop
 

Boller

Banned
Joined
Apr 11, 2006
Messages
2,328
[C:C].SpecialCells(xlCellTypeBlanks).Offset(0, -1).ClearContents
 

Anarki

New Member
Joined
Oct 9, 2006
Messages
5
Boller your code works great! thanks so much for the quick response

Damnnnn i was not able to get your code to work properly but thanks for help
 

Forum statistics

Threads
1,136,421
Messages
5,675,759
Members
419,585
Latest member
popsin

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
Top