VBA automatically delete row if cell = 'Y'

charlesgy

New Member
Joined
Aug 7, 2017
Messages
11
I'm trying to find a code that will allow me to input a 'Y' and allows a row on the next sheet to stay populated.

but if the cell is empty I want the entire row to be delete.

so if c23 = Y
row 11 stays

if c23= (blank) or N
row 11 is deleted.


I will need a very similar code for around 50-60 cells, and with a corresponding row to be deleted/kept.
 
G32 is linked with row 49 so that would be deleted.
Do you mean G32 has hyperlink to row 49? What does the hyperlink look like?
 
Upvote 0

Excel Facts

Copy formula down without changing references
If you have =SUM(F2:F49) in F50; type Alt+' in F51 to copy =SUM(F2:F49) to F51, leaving the formula in edit mode. Change SUM to COUNT.
no, there are no hyperlinks, I just mean that each cell will have its own dedicated row on the second sheet.

that if the cell on the first sheet is either 'Y' or 'N' will determine if it is deleted or not.

I'm trying to make a risk assessment process easier, by automatically populating the second sheet if the cell has had the correct input put in.
 
Upvote 0
E16 – row 12
E17 - 13
E18 - 14
E19 – 15
E20- 16
K16- 17
K17- 18
K18- 19
K19- 20
C23- 21
C24 – 22
C26 – 23
C27 – 24
C28 – 25
C29 -26
C31 – 27
C32- 28
C33 - 29
C34 - 30
C35 - 31
C36 - 32
C37 -33
C39 – 34
C40 - 35
C41 - 36
C42 - 37
C43 - 38
C44 - 39
C45 - 40
C46 – 41


they are a few of the cells, and the represented row, hopefully this helps
 
Upvote 0
E16 – row 12
E17 - 13
E18 - 14
E19 – 15
E20- 16
K16- 17
K17- 18
K18- 19
K19- 20
C23- 21
C24 – 22
C26 – 23
C27 – 24
C28 – 25
C29 -26
C31 – 27
C32- 28
C33 - 29
C34 - 30
C35 - 31
C36 - 32
C37 -33
C39 – 34
C40 - 35
C41 - 36
C42 - 37
C43 - 38
C44 - 39
C45 - 40
C46 – 41


they are a few of the cells, and the represented row, hopefully this helps
 
Upvote 0
Where is the above information located? In a sheet somewhere?
And why there is col E but no col G?
 
Upvote 0
i pulled the information off myself as I don't have a way of linking the spreadsheet.

there will be cells in col G and K. I just didn't add all the cells for the sake of a long post.
 
Upvote 0
Well, I think you should place the information for all related cells in a sheet, say sheet “List” col A, so I can write a macro that will use that info.
 
Upvote 0

Forum statistics

Threads
1,223,234
Messages
6,170,891
Members
452,366
Latest member
TePunaBloke

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