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 :biggrin:

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
:confused:

Yes / NoActionsCosts
LegalLegal
CostsCosts
info bulletininformation bulletin
Market Value Market Value
Business income Business income
fine paid fines paid
Garage Garage
Unused areaUnused area

<tbody>
</tbody>



 

Excel Facts

What is the last column in Excel?
Excel columns run from A to Z, AA to AZ, AAA to XFD. The last column is XFD.
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,214,982
Messages
6,122,573
Members
449,089
Latest member
Motoracer88

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