By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,985 Members | 1,861 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,985 IT Pros & Developers. It's quick & easy.

Test all cells in a column

P: 469
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
Share this Question
Share on Google+
1 Reply

Expert 100+
P: 1,295
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.