Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
TDC TDC is offline
external usenet poster
 
Posts: 14
Default Text Box value to hide a row in another worksheet

I am trying to use a TextBox value to determine if a row on another
spreadsheet should be visible or not. I have the following:

Private Sub Worksheet_Change(ByVal Target As Range)

If Worksheets("Input Page").TB21.Value = 0 Then
Worksheets("Summary Report").Rows(19).EntireRow.Hidden = True
Else
Worksheets("Summary Report").Rows(19).EntireRow.Hidden = False
End If
End Sub

It works if I manually override the value in the TextBox's linked cell; say
AC49, but will not if I simply change the value in the TextBox itself like I
would like the user to do.

Any suggestions?

  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3,942
Default Text Box value to hide a row in another worksheet

hi,
The reason it doesn't work is because you are using the worksheet change
event.
this doesn't work on text boxes. in stead put the code in the text box
change event.
chick designright click text boxselect view code.

Private Sub TextBox1_Change()
If Worksheets("Sheet1").TextBox1.Value = 0 Then
Worksheets("Sheet2").Rows(19).EntireRow.Hidden = True
Else
Worksheets("Sheet2").Rows(19).EntireRow.Hidden = False
End If
End Sub

worked for me. i'm using xl

Regards
FSt1

"TDC" wrote:

I am trying to use a TextBox value to determine if a row on another
spreadsheet should be visible or not. I have the following:

Private Sub Worksheet_Change(ByVal Target As Range)

If Worksheets("Input Page").TB21.Value = 0 Then
Worksheets("Summary Report").Rows(19).EntireRow.Hidden = True
Else
Worksheets("Summary Report").Rows(19).EntireRow.Hidden = False
End If
End Sub

It works if I manually override the value in the TextBox's linked cell; say
AC49, but will not if I simply change the value in the TextBox itself like I
would like the user to do.

Any suggestions?

  #3   Report Post  
Posted to microsoft.public.excel.misc
TDC TDC is offline
external usenet poster
 
Posts: 14
Default Text Box value to hide a row in another worksheet

THANK YOU FSt1. You don't know how long I have been trying to figure that
out and been looking at the round end. The fix was actually too easy once
you showed it to me. Again, thank you.

"FSt1" wrote:

hi,
The reason it doesn't work is because you are using the worksheet change
event.
this doesn't work on text boxes. in stead put the code in the text box
change event.
chick designright click text boxselect view code.

Private Sub TextBox1_Change()
If Worksheets("Sheet1").TextBox1.Value = 0 Then
Worksheets("Sheet2").Rows(19).EntireRow.Hidden = True
Else
Worksheets("Sheet2").Rows(19).EntireRow.Hidden = False
End If
End Sub

worked for me. i'm using xl

Regards
FSt1

"TDC" wrote:

I am trying to use a TextBox value to determine if a row on another
spreadsheet should be visible or not. I have the following:

Private Sub Worksheet_Change(ByVal Target As Range)

If Worksheets("Input Page").TB21.Value = 0 Then
Worksheets("Summary Report").Rows(19).EntireRow.Hidden = True
Else
Worksheets("Summary Report").Rows(19).EntireRow.Hidden = False
End If
End Sub

It works if I manually override the value in the TextBox's linked cell; say
AC49, but will not if I simply change the value in the TextBox itself like I
would like the user to do.

Any suggestions?

  #4   Report Post  
Posted to microsoft.public.excel.misc
TDC TDC is offline
external usenet poster
 
Posts: 14
Default Text Box value to hide a row in another worksheet

How can I change the following to hide the row if the textbox is blank or zero?

Private Sub TextBox21_Change()
If Worksheets("Input Page").TextBox21.Value = 0 Then
Worksheets("Summary Report").Rows(19).EntireRow.Hidden = True
Else
Worksheets("Summary Report").Rows(19).EntireRow.Hidden = False
End If
End Sub

"TDC" wrote:

THANK YOU FSt1. You don't know how long I have been trying to figure that
out and been looking at the round end. The fix was actually too easy once
you showed it to me. Again, thank you.

"FSt1" wrote:

hi,
The reason it doesn't work is because you are using the worksheet change
event.
this doesn't work on text boxes. in stead put the code in the text box
change event.
chick designright click text boxselect view code.

Private Sub TextBox1_Change()
If Worksheets("Sheet1").TextBox1.Value = 0 Then
Worksheets("Sheet2").Rows(19).EntireRow.Hidden = True
Else
Worksheets("Sheet2").Rows(19).EntireRow.Hidden = False
End If
End Sub

worked for me. i'm using xl

Regards
FSt1

"TDC" wrote:

I am trying to use a TextBox value to determine if a row on another
spreadsheet should be visible or not. I have the following:

Private Sub Worksheet_Change(ByVal Target As Range)

If Worksheets("Input Page").TB21.Value = 0 Then
Worksheets("Summary Report").Rows(19).EntireRow.Hidden = True
Else
Worksheets("Summary Report").Rows(19).EntireRow.Hidden = False
End If
End Sub

It works if I manually override the value in the TextBox's linked cell; say
AC49, but will not if I simply change the value in the TextBox itself like I
would like the user to do.

Any suggestions?

  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3,942
Default Text Box value to hide a row in another worksheet

hi,
just add another if. something like this...
Private Sub TextBox1_Change()
If Worksheets("Sheet1").TextBox1.Value = 0 Then
Worksheets("Sheet2").Rows(19).EntireRow.Hidden = True
Else
If Worksheets("sheet1").TextBox1.Value = "" Then
Worksheets("Sheet2").Rows(19).EntireRow.Hidden = True
Else
Worksheets("Sheet2").Rows(19).EntireRow.Hidden = False
End If
End If
End Sub

worked for me. i'm using xp.
regards
FSt1

"TDC" wrote:

How can I change the following to hide the row if the textbox is blank or zero?

Private Sub TextBox21_Change()
If Worksheets("Input Page").TextBox21.Value = 0 Then
Worksheets("Summary Report").Rows(19).EntireRow.Hidden = True
Else
Worksheets("Summary Report").Rows(19).EntireRow.Hidden = False
End If
End Sub

"TDC" wrote:

THANK YOU FSt1. You don't know how long I have been trying to figure that
out and been looking at the round end. The fix was actually too easy once
you showed it to me. Again, thank you.

"FSt1" wrote:

hi,
The reason it doesn't work is because you are using the worksheet change
event.
this doesn't work on text boxes. in stead put the code in the text box
change event.
chick designright click text boxselect view code.

Private Sub TextBox1_Change()
If Worksheets("Sheet1").TextBox1.Value = 0 Then
Worksheets("Sheet2").Rows(19).EntireRow.Hidden = True
Else
Worksheets("Sheet2").Rows(19).EntireRow.Hidden = False
End If
End Sub

worked for me. i'm using xl

Regards
FSt1

"TDC" wrote:

I am trying to use a TextBox value to determine if a row on another
spreadsheet should be visible or not. I have the following:

Private Sub Worksheet_Change(ByVal Target As Range)

If Worksheets("Input Page").TB21.Value = 0 Then
Worksheets("Summary Report").Rows(19).EntireRow.Hidden = True
Else
Worksheets("Summary Report").Rows(19).EntireRow.Hidden = False
End If
End Sub

It works if I manually override the value in the TextBox's linked cell; say
AC49, but will not if I simply change the value in the TextBox itself like I
would like the user to do.

Any suggestions?



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
VBA to hide a row in different worksheet TDC Excel Discussion (Misc queries) 3 April 24th 23 09:04 PM
d worksheet bar is being hide Tiffany Excel Worksheet Functions 1 February 12th 07 05:36 AM
how to hide worksheet using VB associates Excel Worksheet Functions 1 June 15th 06 08:01 AM
Hide worksheet kuansheng Excel Worksheet Functions 2 February 14th 06 09:36 AM
How do I hide a worksheet in Excel and use a password to un-hide . Dchung Excel Discussion (Misc queries) 3 December 2nd 04 06:24 AM


All times are GMT +1. The time now is 02:23 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"