ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Code not work Take same action on all wkshts or selected works (https://www.excelbanter.com/excel-programming/381799-re-code-not-work-take-same-action-all-wkshts-selected-works.html)

Rookie_User

Code not work Take same action on all wkshts or selected works
 
I am sorry, your write - I mis-spoke it is a validation list. I know the
outer loop works because I took that from another site and tried it and it
works, but when I added all the other stuff it didn't work. If you know how
to make it process worksheets within a selection that would be better. Let
me select them and run then run the macro.

"JLGWhiz" wrote:

You might want to take a look at the InCellDropDown Property in the VBA Help
utility.
It looks like you are trying to modify a validation list, as opposed to a
list box. But, I am not sure of that.

"JLGWhiz" wrote:

I could be wrong, but it looks to me like you are trying to put ten pounds in
a five pound bag.

Shouldn't this:
.ListFillRange = "$N$51:$N$60"
.LinkedCell = "$N$50"
.DropDownLines = 9
be this:
.ListFillRange = "$N$51:$N$60"
.LinkedCell = "$N$50"
.DropDownLines = 10

And this:
.ListFillRange = "$M$51:$M$56"
.LinkedCell = "$M$50"
.DropDownLines = 5

be this:
.ListFillRange = "$M$51:$M$56"
.LinkedCell = "$M$50"
.DropDownLines = 6



"Rookie_User" wrote:

I know this code doesn't work with just selected worksheets but that would be
nice if you know how.

Why doesn't this code work? All I am trying to do is add the list menu size
for a drop down box and add one more item in both cases to the end of the
drop down.

Sub Add_Queue()

ActiveSheet.Shapes("Drop Down 9").Select
With Selection
.ListFillRange = "$N$51:$N$60"
.LinkedCell = "$N$50"
.DropDownLines = 9
.Display3DShading = False
End With

ActiveSheet.Shapes("Drop Down 8").Select
With Selection
.ListFillRange = "$M$51:$M$56"
.LinkedCell = "$M$50"
.DropDownLines = 5
.Display3DShading = False
End With
Range("M56").Select
ActiveCell.FormulaR1C1 = "Queue"

Range("N60").Select
ActiveCell.FormulaR1C1 = "Queue"

Range("I42").Select

End Sub



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

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com