IF cell contains "yes" then provide a series of rows containing data or a column

seekingshred

New Member
Joined
Feb 11, 2019
Messages
1
Hello :grin:

New forum member here and a novice/ intermediate at Excel. Could use some help as I'm not able to get through this on my own.

So presumably I got a data validation list in the first column with Yes/No. When the user chooses the option yes I want the actions and costs column to appear. I'm stuck with the multiple data I got to show its nothing like a Lookup or like that and I can't seem to find a way how to do it
:-?

[TABLE="width: 500"]
<tbody>[TR]
[TD]Yes / No[/TD]
[TD]Actions[/TD]
[TD]Costs[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD]Legal[/TD]
[TD]Legal[/TD]
[/TR]
[TR]
[TD][/TD]
[TD]Costs[/TD]
[TD]Costs [/TD]
[/TR]
[TR]
[TD][/TD]
[TD]info bulletin[/TD]
[TD]information bulletin [/TD]
[/TR]
[TR]
[TD][/TD]
[TD]Market Value [/TD]
[TD]Market Value [/TD]
[/TR]
[TR]
[TD][/TD]
[TD]Business income [/TD]
[TD]Business income [/TD]
[/TR]
[TR]
[TD][/TD]
[TD]fine paid [/TD]
[TD]fines paid [/TD]
[/TR]
[TR]
[TD][/TD]
[TD]Garage [/TD]
[TD]Garage [/TD]
[/TR]
[TR]
[TD][/TD]
[TD]Unused area[/TD]
[TD]Unused area[/TD]
[/TR]
</tbody>[/TABLE]



 

Excel Facts

Format cells as time
Select range and press Ctrl+Shift+2 to format cells as time. (Shift 2 is the @ sign).
So you have a Data Validation list In all you cells in column A
And if you choose "Yes" You want columns B and C Visible
But if you choose "No" you want Columns B and C Hidden

Is that what you want.
And you know this will require Vba
 
Upvote 0
If the answer to my questions are yes then try this:
If No please re explain your needs.

This is an auto sheet event script
Your Workbook must be Macro enabled
To install this code:
Right-click on the sheet tab
Select View Code from the pop-up context menu
Paste the code in the VBA edit window

With this script it will run any time you manually enter or from a Data Validation list choose Yes or No

Code:
Private Sub Worksheet_Change(ByVal Target As Range)
'Modified  2/11/2019  6:06:19 PM  EST
If Target.Column = 1 Then
If Target.Cells.CountLarge > 1 Or IsEmpty(Target) Then Exit Sub
If Target.Value = "Yes" Then Columns("B:C").Hidden = False
If Target.Value = "No" Then Columns("B:C").Hidden = True
End If
End Sub
 
Last edited:
Upvote 0

Forum statistics

Threads
1,223,896
Messages
6,175,263
Members
452,627
Latest member
KitkatToby

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