LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 39
Default Possible Data Type Issue

Hi.

I'm having some difficulty with a for..next that is exiting early.
There is no error thrown. See code below...

ReDim b(1 To lastRow) 'VERIFIED TO BE OF VALUE 3123
For i = 1 To lastRow
With Cells(1, 1).Offset(i, 0)
b(i) = Trim(unit(.Offset(i, 1), .Offset(i, 2)))
End With
Next

The 'unit' function just concatenates the values...
Function unit(model As String, serial As String) As String

Nowhere in the function is the value of i changed. It is only used
once in a debug.print statement....
Debug.Print i & " = " & unit

This all works perfectly right up until i = 1561, which is half of the
lastRow. Why it would fail there I don't know. The value in the cells
to be concatenated for i = 1561 is identical to the values for 1562,
but 1562 fails inside the function....

Function unit(model As String, serial As String) As String

'VALIDATE ARGS
If Not (Len(model)) 0 Or Not (Len(serial)) 0 Then
unit = "x"
Exit Function
End If

So again, everything i = 1 to 1561 passes just fine and everything
after, i = 1562 to 3123 fails

Thanks for any assistance you can offer.

Shelton


 
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
IF AND MATCH data type issue EZ[_2_] Excel Worksheet Functions 2 June 18th 09 05:35 PM
Move data based on data type WinPro Excel Programming 12 March 29th 08 11:26 AM
create macro to move label type data to column data JonathonWood9 Excel Programming 4 February 21st 05 10:53 PM
What data type? Srdjan Kovacevic Excel Programming 4 October 22nd 03 12:33 PM
Data Type Rick Kalifa Excel Programming 1 October 15th 03 07:19 PM


All times are GMT +1. The time now is 08:43 AM.

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

About Us

"It's about Microsoft Excel"