Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 267
Default filter list combo box move

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?
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default filter list combo box move

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


"Atishoo" wrote in message
...
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?


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 267
Default filter list combo box move

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!!

"Rick Rothstein (MVP - VB)" wrote:

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


"Atishoo" wrote in message
...
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?



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 267
Default filter list combo box move

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

"Atishoo" wrote:

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?

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default filter list combo box move

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


"Atishoo" wrote in message
...
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!!

"Rick Rothstein (MVP - VB)" wrote:

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


"Atishoo" wrote in message
...
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?




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
how to apply filter based on list or combo box?? Jon Excel Discussion (Misc queries) 1 May 13th 09 01:01 PM
Move a single combo box from one cell to another... Jimm Excel Programming 3 May 16th 08 04:55 PM
Help please - List/Filter/Combo Box? Getting Fired Excel Discussion (Misc queries) 0 January 23rd 08 12:32 AM
Filtered list for Combo Box ListFillRange - Nested Combo Boxes DoctorG Excel Programming 3 February 23rd 06 12:15 PM
Combo box to filter gavmer[_95_] Excel Programming 0 October 13th 04 02:19 AM


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

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

About Us

"It's about Microsoft Excel"