469,165 Members | 2,175 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,165 developers. It's quick & easy.

Test all cells in a column

jamesd0142
469 256MB
I have a datagrid (view diagram).

I want to write a procedure that picks out all cells in column 3 (third from the right - column 2, tecnically) and tests each to make sure they are less than 255 characters. If not, msgbox("length too large").

Is this possible and could any point me in the right direction?

I don't even know where to start!

Thanks James
Sep 18 '07 #1
1 836
kadghar
1,295 Expert 1GB
I have a datagrid (view diagram)...
Try checking cell by cell, something like this should help:

Expand|Select|Wrap|Line Numbers
  1. Dim i As Integer
  2. For i = 0 To 2
  3.     If Len(DataGrid1.Rows(i).Cells(2).Value) >= 255 Then
  4.         MsgBox("length too large")
  5.         Exit Sub
  6.     End If
  7. Next
Sep 18 '07 #2

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

reply views Thread by zhoujie | last post: by
1 post views Thread by Mortomer39 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.