ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   need help creating a Worksheet_Change code (https://www.excelbanter.com/excel-worksheet-functions/89012-need-help-creating-worksheet_change-code.html)

Cajun20th

need help creating a Worksheet_Change code
 

I believe I need a Worksheet_Change code from what I have been able to
gather from other posts. I am trying to hide (row 19 on sheet 3) if
(cell d19 of sheet 1 = 0 or blank.

Thanks in advance for any help.

:confused:
Jason


--
Cajun20th
------------------------------------------------------------------------
Cajun20th's Profile: http://www.excelforum.com/member.php...o&userid=34513
View this thread: http://www.excelforum.com/showthread...hreadid=542787


Niek Otten

need help creating a Worksheet_Change code
 
Look he

http://www.cpearson.com/excel/events.htm

--
Kind regards,

Niek Otten

"Cajun20th" wrote in message
...
|
| I believe I need a Worksheet_Change code from what I have been able to
| gather from other posts. I am trying to hide (row 19 on sheet 3) if
| (cell d19 of sheet 1 = 0 or blank.
|
| Thanks in advance for any help.
|
| :confused:
| Jason
|
|
| --
| Cajun20th
| ------------------------------------------------------------------------
| Cajun20th's Profile: http://www.excelforum.com/member.php...o&userid=34513
| View this thread: http://www.excelforum.com/showthread...hreadid=542787
|



Bob Phillips

need help creating a Worksheet_Change code
 
'-----------------------------------------------------------------
Private Sub Worksheet_Change(ByVal Target As Range)
'-----------------------------------------------------------------
Const WS_RANGE As String = "D19"

On Error GoTo ws_exit:
Application.EnableEvents = False
If Not Intersect(Target, Me.Range(WS_RANGE)) Is Nothing Then
With Target
Worksheets("Sheet3").Rows(19).Hidden = _
(.Value = 0 Or .Value = "")
End With
End If

ws_exit:
Application.EnableEvents = True
End Sub

'This is worksheet event code, which means that it needs to be
'placed in the appropriate worksheet code module, not a standard
'code module. To do this, right-click on the sheet tab, select
'the View Code option from the menu, and paste the code in.



--
HTH

Bob Phillips

(remove xxx from email address if mailing direct)

"Cajun20th" wrote
in message ...

I believe I need a Worksheet_Change code from what I have been able to
gather from other posts. I am trying to hide (row 19 on sheet 3) if
(cell d19 of sheet 1 = 0 or blank.

Thanks in advance for any help.

:confused:
Jason


--
Cajun20th
------------------------------------------------------------------------
Cajun20th's Profile:

http://www.excelforum.com/member.php...o&userid=34513
View this thread: http://www.excelforum.com/showthread...hreadid=542787




Cajun20th

need help creating a Worksheet_Change code
 

I thought I would be able to manipulate your response into what i
needed, but i have to admit, I don't know how to do it. I originally
stated that " I am trying to hide (row 19 on sheet 3) if (cell d19 of
sheet 1 = 0 or blank.)"
In actuality, I need sheet 3 to partial reflect off of sheet 1. If
sheet 1 column d on row 'any' has a numeric value greater than 0, then
if true= I want on sheet three row 'any' to show sheet 1 columns a, b,
c, d, row 'any'; otherwise false hide row 'any' on sheet 3.


--
Cajun20th
------------------------------------------------------------------------
Cajun20th's Profile: http://www.excelforum.com/member.php...o&userid=34513
View this thread: http://www.excelforum.com/showthread...hreadid=542787


Bob Phillips

need help creating a Worksheet_Change code
 
'-----------------------------------------------------------------
Private Sub Worksheet_Change(ByVal Target As Range)
'-----------------------------------------------------------------
Const WS_RANGE As String = "D19"

On Error GoTo ws_exit:
Application.EnableEvents = False
If Not Intersect(Target, Me.Range(WS_RANGE)) Is Nothing Then
With Target
If Value = 0 Or .Value = "" Then
Me.Cells(.Row, "A").Resize(0, 4).Copy _
Worksheets("Sheet3").Cells(.Row, "A")
Worksheets("Sheet3").Rows(19).Hidden = False
Else
Worksheets("Sheet3").Rows(19).Hidden = True
End If
End With
End If

ws_exit:
Application.EnableEvents = True
End Sub



--
HTH

Bob Phillips

(remove xxx from email address if mailing direct)

"Cajun20th" wrote
in message ...

I thought I would be able to manipulate your response into what i
needed, but i have to admit, I don't know how to do it. I originally
stated that " I am trying to hide (row 19 on sheet 3) if (cell d19 of
sheet 1 = 0 or blank.)"
In actuality, I need sheet 3 to partial reflect off of sheet 1. If
sheet 1 column d on row 'any' has a numeric value greater than 0, then
if true= I want on sheet three row 'any' to show sheet 1 columns a, b,
c, d, row 'any'; otherwise false hide row 'any' on sheet 3.


--
Cajun20th
------------------------------------------------------------------------
Cajun20th's Profile:

http://www.excelforum.com/member.php...o&userid=34513
View this thread: http://www.excelforum.com/showthread...hreadid=542787





All times are GMT +1. The time now is 12:23 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com