View Single Post
 
Old 02-19-2020, 07:33 PM
Jennifer Murphy's Avatar
Jennifer Murphy Jennifer Murphy is offline Windows XP Office 2007
Competent Performer
 
Join Date: Aug 2011
Location: Silicon Valley
Posts: 234
Jennifer Murphy is on a distinguished road
Default Dim statement for Split array

I don't understand why this code works:
Code:
Dim BlueLite As String          'Light blue RBG values
BlueLite = "219,229,241"        '.
Dim RGBVals As Variant          'Array for indivicdual RGB values
RGBVals = Split(BlueLite, ",")  '.
But this code gets a runtime error '13' (Type mismatch):
Code:
Dim BlueLite As String          'Light blue RBG values
BlueLite = "219,229,241"        '.
Dim RGBVals() As Variant        'Array for indivicdual RGB values
RGBVals = Split(BlueLite, ",")  '.
Aren't the parens required when declaring an array?
Reply With Quote