Link to home
Start Free TrialLog in
Avatar of Cook09
Cook09Flag for United States of America

asked on

Excel Data Validation VBA Expand from 1 Col to 2 Cols

Attached is a workbook where the code works in setting Data Validation for a particular cell. The DV cell only has the missing List Items. In its current form the vba works very well...no complaints.
I would like to expand the code to include one of two Columns, depending upon the ActiveCell.  If the Active Cell is in Col "C" then the code runs.  If the Target is Col "G" then set the DV for that cell.  Both Columns would have Select* in the cell(s) where the DV should be placed. The current code has the Range hard coded. Prefer a more flexible method.

Cook09
DV-Weekdays-1Col.xlsm
Avatar of Martin Liss
Martin Liss
Flag of United States of America image

Please describe what should happen that isn't happening now.
ASKER CERTIFIED SOLUTION
Avatar of Saqib Husain
Saqib Husain
Flag of Pakistan image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Cook09

ASKER

Syed,
Yes this code works as needed...Thanks.  Question though...what causes the Target.Count to increment?
Cook09
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Cook09

ASKER

Appreciate the "It works first time code"...and for the answer to the follow-up question.
Cook09