-
WSscrappe7
AskWoody LoungerPost deleted by gwhitfield
-
WSscrappe7
AskWoody LoungerCould you help witht he following, you helped with this code before
Sub NumColors()
Dim x As Integer
Dim i As Integer
Dim ncell As Range
Dim vColors As Variant
vColors = Array(3, 4, 6, 7, 8, 10, 12)
‘Cells to enter dates are labeled as a range “NUM”
Range(“Num”).Select ‘Cells to enter dates are labeled as a range “NUM”
For Each ncell In Selection
If ncell.Value “” Then ‘ If cell is blank then it gets skipped
ncell.Interior.ColorIndex = vColors(ncell.Value)
Else
ncell.Interior.ColorIndex = xlNone
End If
Next ncell
End SubThis line is causing the problem
ncell.Interior.ColorIndex = vColors(ncell.Value)I get an out of range error if left that way
If i take out the (ncell.value) it colors everything in as 3(red). If i have 100 different values i need them have different colors based on the array? how can i make 100 different ncell values have at least 30-40 different colors based on what i enter in the array??
thanks for the help.Ed
-
WSscrappe7
AskWoody LoungerPieterse, I edited your suggestion to thefollowing
Sub NumColors()
Dim x As Integer
Dim i As Integer
Dim ncell As Range
Dim vColors As Variant
vColors = Array(3, 4, 6, 7, 8, 10, 12)
‘Cells to enter dates are labeled as a range “NUM”
Range(“Num”).Select ‘Cells to enter dates are labeled as a range “NUM”
For Each ncell In Selection
If ncell.Value “” Then ‘ If cell is blank then it gets skipped
ncell.Interior.ColorIndex = vColors(ncell.Value)
Else
ncell.Interior.ColorIndex = xlNone
End If
Next ncell
End SubThis line is causing the problem
ncell.Interior.ColorIndex = vColors(ncell.Value)I get an out of range error if left alone.
If i take out the (ncell.value) it colors everything in as 3(red). If i have 100 different values i need them have different colors based on the array? how can i make 100 different ncell values have at least 30-40 different colors based on what i enter in the array??
thanks for the help. -
WSscrappe7
AskWoody LoungerWORKS GREAT! tomorrow will be the last day of my internship so you may not see too many more of my questions. I greatly appreciate your help. ALL OF IT!!! thanks so much.
-
WSscrappe7
AskWoody LoungerHey Andrew that’s what I’ve been looking for. It allows me to overwrite a list validation based on your input. The only thing is I have 1 button assigned to the macro that contains the Input Box. When the info is entered it becomes pasted to cell A2. I know i can change cell A2 to have it append to wherever i want. How can I make it append to a specific cell that is either highlighted or slected by the user?? thanbks
-
WSscrappe7
AskWoody Loungerthe cells can have values from 1 to 250. so i used i to count them for me. i only pasted a portion of my code, it extends a lot further. i know there is a cleaner way to do this but im still learning so i take what i can get, your knowledge worked perfectly, again.
Ed
-
WSscrappe7
AskWoody LoungerThanks Tom
A note for you, the first line with the appExcel didnt work when i changed it tp GetObject from Create Object. The error was that Active X could not GET. I just reverted back to the old one and it worked fine. The close statement is good now too. Here’s a little more food for thought, if after opening that main file in excel from access could i enter a line of code to run a macro ive made in excel? so it would be open dummy, open main, run xls macro, close dummy? Anything like that even possible?
And i must add that your da man!!!
-
WSscrappe7
AskWoody Loungeri dont think its the file name thats the problem because the program opens the dummy file with no problem. ive tried it the other way and i still get the same thing. maybe there is just a problem with the wording of the line:
appExcel.Workbooks(“G:NEWIDE~1Dummy.xls”).Close False
If the other commands look like appExcel.Workbooks.Open…, why doesnt this one have appExcel.Workbooks.Close… I’m just wondering????
Any more clues?? Thanks
-
WSscrappe7
AskWoody LoungerEven with the fix to the close statement i still get an run time error 9′ – subscript out of range and it highlights that line
appExcel.Workbooks(“G:New IdeasDummy.xls”).Close False
ANy clue what this is or why it happnes? Thanks alot. If this can stop then it’ll be perfect, i hope.
Ed
-
WSscrappe7
AskWoody LoungerWORKS GREAT!!!! can’t thank enough.
-
WSscrappe7
AskWoody LoungerDoes the job perfecty but i get the #VALUE error in all cells that do not have dat on DATA ENTRY SHEET. I tried an IF ISERROR but i couldn’t get itt o work. That was something i learned here. Am i trying the right thing? Is there a way to not display the # VALUE? So close i can smell it….
ED -
WSscrappe7
AskWoody LoungerHere you go, more details are on the INFO tab. thanks.
Ed -
WSscrappe7
AskWoody LoungerFor some reason i am getting a run time error 13 problem when i use the code. This is what i am doing. A name gets selected from a drop down list on sheet 2 in the format ( First, Last). i then need to have this appear as (F. Last) on sheet 1. I figured i could copy the info from the list in sheet2 into sheet 3 and run the code from sheet 3.i could then copy sheet 3 into sheet 1. nobody sees sheet 3 so thres no harm. i cant just run the code in sheet 1 because those cells have the formula
=’Data Entry’!I3 & CHAR(10) & ‘Data Entry’!J3 & CHAR(10) & ‘Data Entry’!K3
it appears VB wont run the code because the cell refernces take presedent over coding format, is that true? either way when the code gets entered into sheet 3 and i try to copy and paste the info from sheet 2 the linestrCell = Target.Value
gives me an error.
What am i doing wrong????
-
WSscrappe7
AskWoody LoungerNever mind the middle initial stuff, not using that anymore.
-
WSscrappe7
AskWoody LoungerHi Andrew the code works fine once i fixed it for the range i needed. Your directions were great. If a person had a middle name could i edit this could to display it as J. D. Smith. So its First Initial., Middle Initial., Last. Sorry for the bother, but its something I just realized migth be a problem. You have no idea how much youve helped, thanks.
![]() |
Patch reliability is unclear, but widespread attacks make patching prudent. Go ahead and patch, but watch out for potential problems. |
SIGN IN | Not a member? | REGISTER | PLUS MEMBERSHIP |

Plus Membership
Donations from Plus members keep this site going. You can identify the people who support AskWoody by the Plus badge on their avatars.
AskWoody Plus members not only get access to all of the contents of this site -- including Susan Bradley's frequently updated Patch Watch listing -- they also receive weekly AskWoody Plus Newsletters (formerly Windows Secrets Newsletter) and AskWoody Plus Alerts, emails when there are important breaking developments.
Get Plus!
Welcome to our unique respite from the madness.
It's easy to post questions about Windows 11, Windows 10, Win8.1, Win7, Surface, Office, or browse through our Forums. Post anonymously or register for greater privileges. Keep it civil, please: Decorous Lounge rules strictly enforced. Questions? Contact Customer Support.
Search Newsletters
Search Forums
View the Forum
Search for Topics
Recent Topics
-
Add serial device in Windows 11
by
Theodore Dawson
58 minutes ago -
Windows 11 users reportedly losing data due forced BitLocker encryption
by
Alex5723
1 hour, 57 minutes ago -
Cached credentials is not a new bug
by
Susan Bradley
5 hours, 31 minutes ago -
Win11 24H4 Slow!
by
Bob Bible
5 hours, 42 minutes ago -
Microsoft hiking XBox prices starting today due to Trump’s tariffs
by
Alex5723
2 hours, 53 minutes ago -
Asus adds “movement sensor” to their Graphics cards
by
n0ads
7 hours, 52 minutes ago -
‘Minority Report’ coming to NYC
by
Alex5723
4 hours, 2 minutes ago -
Apple notifies new victims of spyware attacks across the world
by
Alex5723
16 hours, 34 minutes ago -
Tracking content block list GONE in Firefox 138
by
Bob99
15 hours, 58 minutes ago -
How do I migrate Password Managers
by
Rush2112
1 hour, 48 minutes ago -
Orb : how fast is my Internet connection
by
Alex5723
1 hour, 37 minutes ago -
Solid color background slows Windows 7 login
by
Alex5723
1 day, 4 hours ago -
Windows 11, version 24H2 might not download via Windows Server Updates Services
by
Alex5723
1 day, 2 hours ago -
Security fixes for Firefox
by
Susan Bradley
3 hours, 12 minutes ago -
Notice on termination of services of LG Mobile Phone Software Updates
by
Alex5723
1 day, 14 hours ago -
Update your Apple Devices Wormable Zero-Click Remote Code Execution in AirPlay..
by
Alex5723
2 days ago -
Amazon denies it had plans to be clear about consumer tariff costs
by
Alex5723
1 day, 15 hours ago -
Return of the brain dead FF sidebar
by
EricB
1 day, 2 hours ago -
Windows Settings Managed by your Organization
by
WSDavidO61
5 hours, 16 minutes ago -
Securing Laptop for Trustee Administrattor
by
PeachesP
1 hour, 41 minutes ago -
The local account tax
by
Susan Bradley
1 day, 3 hours ago -
Recall is back with KB5055627(OS Build 26100.3915) Preview
by
Alex5723
2 days, 13 hours ago -
Digital TV Antenna Recommendation
by
Win7and10
2 days, 5 hours ago -
Server 2019 Domain Controllers broken by updates
by
MP Support
3 days ago -
Google won’t remove 3rd party cookies in Chrome as promised
by
Alex5723
3 days, 2 hours ago -
Microsoft Manager Says macOS Is Better Than Windows 11
by
Alex5723
3 days, 5 hours ago -
Outlook (NEW) Getting really Pushy
by
RetiredGeek
2 days, 8 hours ago -
Steps to take before updating to 24H2
by
Susan Bradley
6 hours, 8 minutes ago -
Which Web browser is the most secure for 2025?
by
B. Livingston
2 days, 12 hours ago -
Replacing Skype
by
Peter Deegan
2 days, 1 hour ago
Recent blog posts
Key Links
S | M | T | W | T | F | S |
---|---|---|---|---|---|---|
1 | 2 | 3 | ||||
4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 | 12 | 13 | 14 | 15 | 16 | 17 |
18 | 19 | 20 | 21 | 22 | 23 | 24 |
25 | 26 | 27 | 28 | 29 | 30 | 31 |
Want to Advertise in the free newsletter? How about a gift subscription in honor of a birthday? Send an email to sb@askwoody.com to ask how.
Mastodon profile for DefConPatch
Mastodon profile for AskWoody
Home • About • FAQ • Posts & Privacy • Forums • My Account
Register • Free Newsletter • Plus Membership • Gift Certificates • MS-DEFCON Alerts
Copyright ©2004-2025 by AskWoody Tech LLC. All Rights Reserved.