filter list combo box move

A

Atishoo

am trying to get a combo box to appear when a specified cell is visble
through selection via a filter list am trying this code:

Private Sub Worksheet_SelectionChange(ByVal Target As Range)



With ActiveSheet.CommandButton3
If Workbooks("Ward").Range("B9").Visible = True Then

.Visible = True
.Top = Range("f2").Top
.Left = Range("f2").Left
Else: .Visible = False
End If
End With

End Sub

But excell doesnt like the "if visible = true" I know this works for
envelopevisible but not in this instance!!
any inspiration?
 
R

Rick Rothstein \(MVP - VB\)

I think you will want to change this line...

If Workbooks("Ward").Range("B9").Visible = True Then

to this instead...

If Target.Address = "$B$9" Then

You didn't post enough information for me to know or not, but could you use
Data/Validation (setting the Allow option to List) maybe?

Rick
 
A

Atishoo

Hi rick thanks for your help sorry I didnt give all info.
what i have is a page that lists the patients on different wards these can
be viewed by each ward by selecting the wards from an autofilter drop down
box on the page.
i have a series of email command buttons that will automatically email the
page to the respective wards. To stop people sending the wrong info to the
wrong ward i want only the respective email button to appear when the ward is
chosen from the auto filter list, hence if cell b9 (which contains the name
of ward 1) is visible then command button is visble!!
 
A

Atishoo

still having no joy with this problem I just need to know how to structure an
if, then command based on weather a certain cell is visible on a page or not
 
R

Rick Rothstein \(MVP - VB\)

Okay, I think I see what you are doing now. Try testing for B9's
"visibility" this way...

If Workbooks("Ward").Range("B9").RowHeight > 0 Then

Rick
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top