Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
DeN DeN is offline
external usenet poster
 
Posts: 15
Default Macro or VB code to hide and unhide Label box

I need your help to create a macro or a Visual Basic code that do the
following: I have a cell with a macro that shows Meets or Does not Meets
depending of the result of other cell. That Im trying to do is a macro or
visual basic code that display a Label box when Meets is showed and hidden
it when Does not Meet is showed. I'm trying a VB code using the if
statement to change the visible property (to False and True) of the Label
box but is not working. I'm not very familiarized with visual basic and Im
not at the level of skills of many of you so please take that in
consideration for any suggestion.

Thanks in advance

  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3,942
Default Macro or VB code to hide and unhide Label box

hi
i use a label from the control toolbox for this.
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Set Target = Range("A2") '<<<<<change to suit your data
If Target.Value = "meets" Then
Label1.Visible = True
Else
Label1.Visible = False
End If
End Sub

this is sheet code. right click the sheet tab and click view code. paste the
code in the code pane that comes up.

regards
FSt1

"Den" wrote:

I need your help to create a macro or a Visual Basic code that do the
following: I have a cell with a macro that shows Meets or Does not Meets
depending of the result of other cell. That Im trying to do is a macro or
visual basic code that display a Label box when Meets is showed and hidden
it when Does not Meet is showed. I'm trying a VB code using the if
statement to change the visible property (to False and True) of the Label
box but is not working. I'm not very familiarized with visual basic and Im
not at the level of skills of many of you so please take that in
consideration for any suggestion.

Thanks in advance

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Slow VBA code....Hide/Unhide Loop Tami Excel Worksheet Functions 2 August 4th 09 01:53 AM
VB Code to hide and unhide rows Raj Excel Discussion (Misc queries) 2 February 27th 08 05:58 AM
Code for button to hide/unhide rows Chris Excel Worksheet Functions 5 March 5th 07 06:15 AM
Macro that will unhide then hide rows minka Excel Discussion (Misc queries) 10 October 21st 06 01:37 PM
hide/unhide macro Matt Excel Discussion (Misc queries) 2 April 6th 06 07:24 PM


All times are GMT +1. The time now is 07:38 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright 2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"