Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 12
Default see if dynamic array used

Im checking 1 file against another (the files contain names). File 1 is up to
date names and file 2 is 5 days behind. Basically both files should be
identical, but occasionally a new name is added to file 1. What Im doing is
comparing files and any names that are in file 1 but not in file 2 are added to
a dynamic array, then listed to a column. No problems here. My problem is if no
new names are added, the array is not used. How do I check if an array is not
used.
If DnExist(1) < "" Then
Application.Goto Reference:="Dates2" ' pastes list of names not in File 2 into
dates sheet
Range("d8").Resize(UBound(DnExist)) = Application.Transpose(DnExist).
This works if there are new names if not I get Subscript out of range. Ive
tried if array empty as well. Any advice would be appreciated.
Regards Robert


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default see if dynamic array used

error check the ubound of the array

dim intTemp as integer
dim bolNothing as boolean

bolNothing = false
on error goto OutOfBounds
intTemp = ubound(array)
on error goto 0
if bolnothing = true then
''do what you need to do when nothing in array
endif
'''proced with code if there is stuff in array


OutOfBounds:
'''Your array has nothing
bolNothing = true
resume next

Keith
www.kjtfs.com


---
Message posted from http://www.ExcelForum.com/

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 12
Default see if dynamic array used

Keith, thankyou for reply. Ill put this to good use. This also shows me a
little bit more about working with arrays.
Regards Robert
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
Dynamic Sum Array Formula Input Help excelCPA Excel Discussion (Misc queries) 3 September 25th 09 06:40 PM
Validation list via dynamic array in VBA Brady Excel Discussion (Misc queries) 1 February 8th 07 03:15 PM
array formula with a dynamic range. Dave Excel Worksheet Functions 2 June 26th 06 06:16 AM
How to declare a dynamic array Peter Rooney Excel Discussion (Misc queries) 4 April 13th 05 01:25 PM
Q: Declaring a dynamic array Srdjan Kovacevic[_4_] Excel Programming 1 January 16th 04 07:24 PM


All times are GMT +1. The time now is 09:49 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"