ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Target Address/Value Macro Won't Work (https://www.excelbanter.com/excel-programming/354352-target-address-value-macro-wont-work.html)

Paige

Target Address/Value Macro Won't Work
 
I have a merged cell (C90:F90) to be used for text entry. It has a drop-down
for the user to select a response. If the user selects "via another method",
it should unhide row 91; if they select anything else, or delete an entry
already in there (that they inputted earlier perhaps), then row 91 should be
hidden. When I use the following code, it works except for when a current
entry is deleted - then I get a type mismatch error. Can someone please
advise what I've done wrong here?

If Not Intersect(Target, Range("C" & 90 & ":F" & 90)) Is Nothing Then
If Target.Value < "via another method" Then
Rows("91").Hidden = True
Else
Rows("91").Hidden = False
End If
End If


Tom Ogilvy

Target Address/Value Macro Won't Work
 
If Not Intersect(Target, Range("C90:F90")) Is Nothing Then
If Target(1).Value = "via another method" Then
Rows("91").Hidden = False
Else
Rows("91").Hidden = True
End If
End If

--
Regards,
Tom Ogilvy



"Paige" wrote in message
...
I have a merged cell (C90:F90) to be used for text entry. It has a

drop-down
for the user to select a response. If the user selects "via another

method",
it should unhide row 91; if they select anything else, or delete an entry
already in there (that they inputted earlier perhaps), then row 91 should

be
hidden. When I use the following code, it works except for when a current
entry is deleted - then I get a type mismatch error. Can someone please
advise what I've done wrong here?

If Not Intersect(Target, Range("C" & 90 & ":F" & 90)) Is Nothing Then
If Target.Value < "via another method" Then
Rows("91").Hidden = True
Else
Rows("91").Hidden = False
End If
End If




Paige

Target Address/Value Macro Won't Work
 
Thanks, Tom - works like a charm - you are a peach!!!

"Tom Ogilvy" wrote:

If Not Intersect(Target, Range("C90:F90")) Is Nothing Then
If Target(1).Value = "via another method" Then
Rows("91").Hidden = False
Else
Rows("91").Hidden = True
End If
End If

--
Regards,
Tom Ogilvy



"Paige" wrote in message
...
I have a merged cell (C90:F90) to be used for text entry. It has a

drop-down
for the user to select a response. If the user selects "via another

method",
it should unhide row 91; if they select anything else, or delete an entry
already in there (that they inputted earlier perhaps), then row 91 should

be
hidden. When I use the following code, it works except for when a current
entry is deleted - then I get a type mismatch error. Can someone please
advise what I've done wrong here?

If Not Intersect(Target, Range("C" & 90 & ":F" & 90)) Is Nothing Then
If Target.Value < "via another method" Then
Rows("91").Hidden = True
Else
Rows("91").Hidden = False
End If
End If






All times are GMT +1. The time now is 01:50 AM.

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