unhiding sheet based cell

Public Schedule Face-to-Face & Online Instructor-Led Training - View dates & book

Forum home » Delegate support and help forum » Microsoft Excel VBA Training and help » Unhiding sheet based on cell value

Unhiding sheet based on cell value

resolvedResolved · Medium Priority · Version 2003

Ben has attended:
Excel VBA Intro Intermediate course

Unhiding sheet based on cell value

Hi,

I have a number of worksheets hidden, however i want to unhide the sheets if a cell (u8, on the data entry tab) value = true.

I've tried the following, but i keep getting prof1 is a invalid qualifier.


Option Explicit
Option Compare Text

Dim prof1 As String

Sub unhide()

Sheets("Data Entry").Range("u8").Text = prof1

If prof1.Value = True Then

Sheets("Profile 1 - Expo. Rating").Visible = True

Else

Sheets("Profile 1 - Expo. Rating").Visible = False

End If

End Sub

RE: Unhiding sheet based on cell value

Hi Ben

Thanks for your question

Prof, in your example is a simple string value. Thus the term prof.value has no meaning.

"If Prof = True", would be the correct construct

Regards

Stephen

 

Training courses

 

Training information:

Welcome. Please choose your application (eg. Excel) and then post your question.

Our Microsoft Qualified trainers will then respond within 24 hours (working days).

Frequently Asked Questions
What does 'Resolved' mean?

Any suggestions, questions or comments? Please post in the Improve the forum thread.


 

Excel tip:

Transpose text

You can transpose any range of cells, turning the columns into rows and the rows into columns. Just follow these steps:

Select the range.

Click the Copy button on the Standard toolbar to copy it to the Clipboard.

Select a cell outside of the range you copied.

Select Paste Special from the Edit menu.

In the Paste Special dialog box, click Transpose, then OK.

View all Excel hints and tips


Server loaded in 0.09 secs.