Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 101
Default how to check the array have value

Sub xx()
Dim an_x() As Long
k = 0
For i = 1 To 3
If k = 1 Then
ReDim Preserve an_x(1 To i)
an_x(i) = i + 6
End If
Next
'check whether an_x is empty or not empty.
'how can i know that the array is emptyed.

ubound or isarray or isempty or ismissing....
no ,no,no ???
End Sub


*** Sent via Developersdex http://www.developersdex.com ***
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,302
Default how to check the array have value

Hi X Taol,

Try:
'===========
Sub xx()
Dim an_x() As Long
Dim k As Long, i As Long
Dim v As Variant

k = 0
For i = 1 To 3
If k = 1 Then
ReDim Preserve an_x(1 To i)
an_x(i) = i + 6
End If
Next

On Error Resume Next
v = UBound(an_x)
On Error GoTo 0

If IsEmpty(v) Then MsgBox "an_x is empty"

End Sub
'<<===========

---
Regards,
Norman



"x taol" wrote in message
...
Sub xx()
Dim an_x() As Long
k = 0
For i = 1 To 3
If k = 1 Then
ReDim Preserve an_x(1 To i)
an_x(i) = i + 6
End If
Next
'check whether an_x is empty or not empty.
'how can i know that the array is emptyed.

ubound or isarray or isempty or ismissing....
no ,no,no ???
End Sub


*** Sent via Developersdex http://www.developersdex.com ***



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
how do I check if known number is in array Iain - T Excel Discussion (Misc queries) 6 January 30th 06 04:26 AM
check value with array, Application.Match Przemek Excel Programming 5 August 25th 05 12:09 PM
Array Check NacellesEng Excel Programming 7 April 28th 05 08:22 PM
Check if first character of string is in array Jonathan[_8_] Excel Programming 4 October 11th 03 12:07 AM
Check if a String is inside an Array Alan Beban[_3_] Excel Programming 0 September 3rd 03 07:44 PM


All times are GMT +1. The time now is 07:23 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"