Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
i am using this to populate an array
arr = .Range("B12:B" & lRow).Value then i use this to work with the array For x = LBound(arr) To UBound(arr) If arr(x, 1) "" Then the problem is when lrow = 12 (only 1 element in array), i get a type mismatch. how can i get around it? -- Gary |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi Gary,
One way, try something like: Arr = Range("B12:B" & LRow).Value 'then i use this to work with the array If IsArray(Arr) Then For x = LBound(Arr) To UBound(Arr) If Arr(x, 1) "" Then 'do someting,e.g.: MsgBox Arr(x, 1) End If Next x Else If Not IsEmpty(Arr) Then 'do something MsgBox Arr End If End If --- Regards, Norman "Gary Keramidas" <GKeramidasATmsn.com wrote in message ... i am using this to populate an array arr = .Range("B12:B" & lRow).Value then i use this to work with the array For x = LBound(arr) To UBound(arr) If arr(x, 1) "" Then the problem is when lrow = 12 (only 1 element in array), i get a type mismatch. how can i get around it? -- Gary |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
i'll give it a shot, norman.
as a temporary fix i just set the lrow to 13 when it = 12, so the client could enter some data they needed to get in. thanks -- Gary "Norman Jones" wrote in message ... Hi Gary, One way, try something like: Arr = Range("B12:B" & LRow).Value 'then i use this to work with the array If IsArray(Arr) Then For x = LBound(Arr) To UBound(Arr) If Arr(x, 1) "" Then 'do someting,e.g.: MsgBox Arr(x, 1) End If Next x Else If Not IsEmpty(Arr) Then 'do something MsgBox Arr End If End If --- Regards, Norman "Gary Keramidas" <GKeramidasATmsn.com wrote in message ... i am using this to populate an array arr = .Range("B12:B" & lRow).Value then i use this to work with the array For x = LBound(arr) To UBound(arr) If arr(x, 1) "" Then the problem is when lrow = 12 (only 1 element in array), i get a type mismatch. how can i get around it? -- Gary |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
array, range question | Excel Discussion (Misc queries) | |||
copy one array formula to an array range | Excel Programming | |||
Question about working with range array | Excel Programming | |||
Tricky array formula issue - Using array formula on one cell, then autofilling down a range | Excel Programming | |||
Range Question / error 1004: method Range of object Worksheet has failed | Excel Programming |