Cell referencing

sanky9192

New Member
Joined
Sep 13, 2016
Messages
3
I need to hide and unhide the shapes located in din different worksheet based on a cell value which is in other sheet.

For example cell H6 is in the sheet 1 in which the code is written and shapes are in the MassBalanceLSFO sheet.

Both are in single file.

Thanks in advance.



Private Sub Worksheet_Change(ByVal Target As Range)


If Range("H6").Value = "NO" Then


Rows("52:57").EntireRow.Hidden = True
Worksheets("Without GGH").Visible = True
Worksheets("GGH").Visible = False
Worksheets("MassBalanceLSFO").Shapes("WOGGH").Visible = True
Worksheets("MassBalanceLSFO").Shapes("WGGH").Visible = False

ElseIf Range("H6").Value = "YES" Then


Rows("52:57").EntireRow.Hidden = False
Worksheets("Without GGH").Visible = False
Worksheets("GGH").Visible = True
Worksheets("MassBalanceLSFO").Shapes("WOGGH").Visible = False
Worksheets("MassBalanceLSFO").Shapes("WGGH").Visible = True

End If


End Sub
 

Excel Facts

Return population for a City
If you have a list of cities in A2:A100, use Data, Geography. Then =A2.Population and copy down.
Hi
Welcome to the board

And what is your problem?

Your code seems fine, do you get some error?
What happens that is not what you expect?
 
Upvote 0

Forum statistics

Threads
1,222,903
Messages
6,168,939
Members
452,227
Latest member
sam1121

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