basic unhide sheet text&B1

Peterfc2

Active Member
Joined
Jan 2, 2004
Messages
394
Office Version
  1. 2013
Platform
  1. Windows
I have two sheets I want to unhide.

Worksheets("FIXTURES 1990-91").Visible = True
Worksheets("STATS 1990-91").Visible = True

This works ok, but I need to say

Worksheets("FIXTURES & B1").Visible = True
Worksheets("STATS & B1").Visible = True
Where cell B1 holds 1990-91.

This doesn't work. My brains gone to sleep. Help Please!
 

Excel Facts

Which Excel functions can ignore hidden rows?
The SUBTOTAL and AGGREGATE functions ignore hidden rows. AGGREGATE can also exclude error cells and more.
Try using

Worksheets("FIXTURES " & B1).Visible = True
Worksheets("STATS " & B1).Visible = True
 
Upvote 0
Hi!

How about this:
Code:
Worksheets("FIXTURES " & Sheets("where b1 contain 1990-91").Range("B1").value).Visible = True
Worksheets("STATS " & Sheets("where b1 contain 1990-91").Range("B1").value).Visible = True
There is a " " (space) after the fixtures and stats, then calling the value of "B1" the Sheets("where b1 contain 1990-91")
 
Upvote 0
Not working
Worksheets("FIXTURES " & B1).Visible = True
Worksheets("STATS " & B1).Visible = True
 
Upvote 0
Oops. Of course it should read:

Worksheets("FIXTURES " & Range("B1").Value).Visible = True
Worksheets("STATS " & Range("B1").Value).Visible = True
 
Upvote 0
YES, THATS GOT IT!
However moving on I get an error if that sheet name is non existent. Anyone know a way of trapping it.
 
Upvote 0
Not sure what you want to do, but here is the code:
Code:
On Error Resume Next
Worksheets("FIXTURES " & Range("B1").Value).Visible = True
On Error Resume Next
Worksheets("STATS " & Range("B1").Value).Visible = True
On Error GoTo 0
 
Upvote 0

Forum statistics

Threads
1,214,833
Messages
6,121,868
Members
449,053
Latest member
Mesh

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