kristalyze
New Member
- Joined
- Mar 13, 2009
- Messages
- 12
Hello,
I've been searching and trying to piece various posts together to get my code to work but it just won't. It seems like it should be simple but alas, my very inadequate code skills are not helping me out.
I am trying to write some code that will loop through all the rows in my table, and check that a specific column has been populated (if the row has data in it). Essentially, I'm trying to make a column mandatory. So far I have the following:
For Each row In [table1].Rows
If row.Column(1).Value <> "" And row.Column(9).Value = "" Then
MsgBox "Please populate Column H"
End If
Next
So its supposed to look at the first column of each row to see if its been populated, and then check the 'mandatory' column to ensure that they've filled it in. When I run it I get a "Wrong number of arguments or invalid property assignments" message and it highlights the .Column section of the code. Can someone help me out?
Thanks all!
I've been searching and trying to piece various posts together to get my code to work but it just won't. It seems like it should be simple but alas, my very inadequate code skills are not helping me out.
I am trying to write some code that will loop through all the rows in my table, and check that a specific column has been populated (if the row has data in it). Essentially, I'm trying to make a column mandatory. So far I have the following:
For Each row In [table1].Rows
If row.Column(1).Value <> "" And row.Column(9).Value = "" Then
MsgBox "Please populate Column H"
End If
Next
So its supposed to look at the first column of each row to see if its been populated, and then check the 'mandatory' column to ensure that they've filled it in. When I run it I get a "Wrong number of arguments or invalid property assignments" message and it highlights the .Column section of the code. Can someone help me out?
Thanks all!