Hide or unhide a cell base on text in a different cell - Either VBA or formula solution.

Liam_1988

New Member
Joined
Apr 30, 2020
Messages
25
Office Version
  1. 2013
Platform
  1. Windows
Hi,

I've been using VBA for about 6 months or so (hobbyist). I'm currently working on a workbook for my job and I'm completely stuck.

XABCD
1​
Sent By:
2​
Date Sent:
3​
Method:Tracking #:

I have the above in place. I'm trying to have it so that C3 & D3 are hidden unless B3 (which has a Data Validation list assigned to it) says "Postal".

I don't mind if this achieved with a Formula or VBA.

Please Please help it's driving me crazy!
 
In what way doesn't that 1st bit of code work?
 
Upvote 0

Excel Facts

How to change case of text in Excel?
Use =UPPER() for upper case, =LOWER() for lower case, and =PROPER() for proper case. PROPER won't capitalize second c in Mccartney
I'm getting this:
1608220925102.png


1608220958933.png

In what way doesn't that 1st bit of code work?
 
Upvote 0
Did you put that code into the relevant sheet module?
 
Upvote 0
It needs to go in the sheet module, not a standard module.
Right click the tab of the sheet you want it to work on & click view code.
Paste the code into the window that opens. The code will run automatically when B83 is changed manually
 
Upvote 0
It needs to go in the sheet module, not a standard module.
Right click the tab of the sheet you want it to work on & click view code.
Paste the code into the window that opens. The code will run automatically when B83 is changed manually
Right ok sorry yes that makes sense. Sorry like I said I'm a hobbyist.

Just a quick question. Is there a run condition other than the content of D84? I was hoping it was automatic.
 
Upvote 0
With the code you showed in post#10
VBA Code:
Private Sub Worksheet_Change(ByVal Target As Range)
  If Target.CountLarge > 1 Then Exit Sub
  If Target.Address(0, 0) = "D83" Then
     Rows(87).Hidden = Not Target.Value = "Postal"
  End If
End Sub
Row 87 will automatically hide/unhide when the value in D83 is changed.

Is that not what you want?
 
Upvote 0
I wanted row 87 to be hidden at all times unless D83 contains the term "Postal" whihc would trigger row 87 to become unhidden.
 
Upvote 0
In that case just hide row 87, then if D83 is changed to Postal it will unhide & if D83 is then changed to anything other than Postal it will hide again.
 
Upvote 0

Forum statistics

Threads
1,214,818
Messages
6,121,725
Members
449,049
Latest member
MiguekHeka

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