Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default placing a pull-down menu at a cell location automatically

Hi there,

I'm wanting to click on any cell in Excel and wanting a
pull down menu to be positioned over that cell location,
when I double click on that cell.

The pull down menu has a list of values (text values), and
once I select a text value from the pull down list, that
value automatically appears in the cell, and the pull down
menu then dissapears.

How do I code this in visual basic?

Cheers KEN
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 493
Default placing a pull-down menu at a cell location automatically

one way:

Put this in your worksheet code module:

Option Explicit
Public gOldActiveCell As Range

Private Sub Worksheet_BeforeDoubleClick( _
ByVal Target As Excel.Range, Cancel As Boolean)
With ActiveCell
With .Validation
.Delete
.Add Type:=xlValidateList, _
AlertStyle:=xlValidAlertStop, _
Formula1:="txt1,txt2,txt3,txt4"
.IgnoreBlank = True
.InCellDropdown = True
End With
End With
Cancel = True
End Sub

Private Sub Worksheet_SelectionChange( _
ByVal Target As Excel.Range)
If Not gOldActiveCell Is Nothing Then _
gOldActiveCell.Validation.Delete
Set gOldActiveCell = ActiveCell
End Sub


In article ,
"Ken Nysse" wrote:

Hi there,

I'm wanting to click on any cell in Excel and wanting a
pull down menu to be positioned over that cell location,
when I double click on that cell.

The pull down menu has a list of values (text values), and
once I select a text value from the pull down list, that
value automatically appears in the cell, and the pull down
menu then dissapears.

How do I code this in visual basic?

Cheers KEN

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,253
Default placing a pull-down menu at a cell location automatically

another way:

use Data/Validation.

keepITcool

< email : keepitcool chello nl (with @ and .)
< homepage: http://members.chello.nl/keepitcool


"J.E. McGimpsey" wrote:

one way:
snAp


In article ,
"Ken Nysse" wrote:

Hi there,

I'm wanting to click on any cell in Excel and wanting a
pull down menu to be positioned over that cell location,
when I double click on that cell.

The pull down menu has a list of values (text values), and
once I select a text value from the pull down list, that
value automatically appears in the cell, and the pull down
menu then dissapears.

How do I code this in visual basic?

Cheers KEN



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 493
Default placing a pull-down menu at a cell location automatically

Note that unless you apply data validation to *every* cell in the
sheet, this can't meet the OP's requirement that the dropdown should
appear when he clicks "on any cell", and doesn't meet at all the
requirement that it appear "when I double click on that cell".

In article ,
keepitcool wrote:

another way:

use Data/Validation.

keepITcool

< email : keepitcool chello nl (with @ and .)
< homepage: http://members.chello.nl/keepitcool


"J.E. McGimpsey" wrote:

one way:
snAp


In article ,
"Ken Nysse" wrote:

Hi there,

I'm wanting to click on any cell in Excel and wanting a
pull down menu to be positioned over that cell location,
when I double click on that cell.

The pull down menu has a list of values (text values), and
once I select a text value from the pull down list, that
value automatically appears in the cell, and the pull down
menu then dissapears.

How do I code this in visual basic?

Cheers KEN



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default placing a pull-down menu at a cell location automatically

Instead of having a listbox drop down - is it possible to have a check
box drop down so the user can choose multiple values (seperated by a
comma)?

Thanks,
Robin



------------------------------------------------
~~ Message posted from http://www.ExcelTip.com/
~~ View and post usenet messages directly from http://www.ExcelForum.com/

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
change cell contents when pull down menu choices change jb21 Excel Worksheet Functions 3 November 21st 08 10:34 PM
Auto pull 3 cells into 1 cell at different location? (Excel) Roady Excel Discussion (Misc queries) 1 May 20th 08 04:10 PM
Placing a Command Button in a New Tool Menu Office Junior[_2_] Excel Discussion (Misc queries) 2 May 12th 07 04:50 PM
Excel pull down menu kwf Excel Worksheet Functions 0 March 9th 06 04:17 PM
Pull Down Menu Bar JB in Kansas Excel Discussion (Misc queries) 2 May 30th 05 02:20 PM


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