Changing Values through IF statement

Joined
May 27, 2018
Messages
1
I have a spreadsheet that tracks tasks with drop down boxes that include the values B, G ,Y, A, and N/A. The number of each status is calculated at the top of the sheet through a count if statement.
I am hoping to add in another drop down box above each section using the same as the above. So you can select N/A for a team. When selecting the N/A for the team I need a section of rows to also be set to N/A and hide the lines.
I am struggling to understand what I should be adding to set the cells to N/A - Please can someone help.
Private Sub Worksheet_Change(ByVal Target As Range)
<code style="margin: 0px; padding: 0px; border: 0px; font-style: inherit; font-variant: inherit; font-weight: inherit; font-stretch: inherit; line-height: inherit; font-family: Consolas, Menlo, Monaco, "Lucida Console", "Liberation Mono", "DejaVu Sans Mono", "Bitstream Vera Sans Mono", "Courier New", monospace, sans-serif; vertical-align: baseline; box-sizing: inherit; white-space: inherit;">If Range("G13") = "N/A" Then
</code>Set cells E14-E22 TO N/A and hide rows 14 - 22
<code style="margin: 0px; padding: 0px; border: 0px; font-style: inherit; font-variant: inherit; font-weight: inherit; font-stretch: inherit; line-height: inherit; font-family: Consolas, Menlo, Monaco, "Lucida Console", "Liberation Mono", "DejaVu Sans Mono", "Bitstream Vera Sans Mono", "Courier New", monospace, sans-serif; vertical-align: baseline; box-sizing: inherit; white-space: inherit;"> 'Range("14:22").EntireRow.Hidden = True'


Else
Range("14:22").EntireRow.Hidden = False

End If
</code>End Sub
 

Excel Facts

What is the shortcut key for Format Selection?
Ctrl+1 (the number one) will open the Format dialog for whatever is selected.
Try:

Code:
Range("A14:A22").EntireRow.Hidden = True

Also if your first line doesn't work as-is, try this:

Code:
If Not Intersect(Target, Range("G13")) Is Nothing Then
 
Upvote 0

Forum statistics

Threads
1,223,742
Messages
6,174,240
Members
452,553
Latest member
red83

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