LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8
Default multiple choices from pulldown... how to apply to several pulldown

Hi,
Follow up: I first added to original question, but it's really a new
question.

After using the code Debra was kind enough to share, I need to apply the
action (choose from a pull down menu and place each entry
into a new row) to 4 or 5 specific columns. I tried the following but it
didn't work.(see row surrounded by *****)
Thanks for any help.

Here's the code: (the line with all the stars is what I tried).
------
Public Sub Worksheet_Change(ByVal Target As Range)
On Error GoTo exitHandler

Dim rngDV As Range
Dim lRow As Long
Dim lCol As Long

********lCol = 7 or 14 or 18 or 12 'column with data validation cell****
(I also tried using "And")


If Target.Count 1 Then GoTo exitHandler

On Error Resume Next
Set rngDV = Cells.SpecialCells(xlCellTypeAllValidation)
On Error GoTo exitHandler
If rngDV Is Nothing Then GoTo exitHandler
If Intersect(Target, rngDV) Is Nothing Then
'do nothing
Else
Application.EnableEvents = False
If Target.Column = lCol Then
If Target.Value = "" Then GoTo exitHandler
If Target.Offset(0, 1).Value = "" Then
lRow = Target.Row
Else
lRow = Cells(Rows.Count, lCol + 1).End(xlUp).Row + 1
End If

Cells(lRow, lCol + 1).Value = Target.Value
End If
End If

exitHandler:
Application.EnableEvents = True

End Sub


 
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
Autofilter Pulldown daveroblit Excel Programming 8 December 29th 05 07:56 PM
Using value from pulldown box in macro k Excel Programming 2 April 7th 04 08:01 PM
pulldown boxes Gord Dibben[_3_] Excel Programming 0 July 25th 03 12:08 AM
pulldown boxes Debra Dalgleish[_2_] Excel Programming 0 July 25th 03 12:01 AM
pulldown boxes Dan E[_2_] Excel Programming 0 July 24th 03 11:54 PM


All times are GMT +1. The time now is 09:27 AM.

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

About Us

"It's about Microsoft Excel"