PDA

View Full Version : Drop down on every cell in column



enfantter
02-22-2010, 11:39 PM
Hi all,

I want to write a code which can, when executed create similar drop down lists on every cell in a column in excel - is this possible !?

Please let me know if i have explained myself in a clear fashion ...

enfantter
02-23-2010, 12:57 AM
I'm thinking something like, if you click on one cell (in a row), then you get the possibility of selecting from a drop down list ...

Bob Phillips
02-23-2010, 01:05 AM
Do you mean something like this



With Range("A1:A5")
.Validation.Delete
.Validation.Add Type:=xlValidateList, Formula1:="=dvList"
End With

enfantter
02-23-2010, 01:31 AM
sorry i didnt get this one ...
what does this code do ?!

Bob Phillips
02-23-2010, 01:36 AM
Adds data validation to a specified range.

domfootwear
02-23-2010, 01:58 AM
Hi all,

I want to write a code which can, when executed create similar drop down lists on every cell in a column in excel - is this possible !?

Please let me know if i have explained myself in a clear fashion ...

You can use Combobox to do this

Try this code:


Sub Worksheet_Selectionchange(ByVal target As Range)
On Error Resume Next
With ComboBox1
If target.Column = 1 Then
.Visible = True
.Top = target.Top
.Height = target.Height
.Left = target.Left
.Width = target.Width
.LinkedCell = target
ElseIf Application.CutCopyMode = False Then
.Visible = False
End If
End With
End Sub

Private Sub ComboBox1_Change()
ActiveCell.Value = ComboBox1.Value
End Sub


Pls download file as below

enfantter
02-23-2010, 04:09 AM
@domfootwear:

this is exactly what i need!! :)
now im just trying to figure out how you did it ...
did you initially insert a combobox on column A?

enfantter
02-23-2010, 11:39 PM
How does the combobox get on to every cell in the column ?!
Is there something obvious i dont see ?!

domfootwear
02-23-2010, 11:57 PM
How does the combobox get on to every cell in the column ?!
Is there something obvious i dont see ?!
Sorry I can not up file on this forum,
Pls see the video clip as below link:
http://www.4shared.com/file/228626523/afdfdffe/combo.html

enfantter
02-24-2010, 12:05 AM
hmmm ... i cant see the file when i download it ..
can you send it ?!

domfootwear
02-24-2010, 12:23 AM
hmmm ... i cant see the file when i download it ..
can you send it ?!
Can you send to me your private email address ?
My email: david@dowell-plus.co.kr