gheyman
Well-known Member
- Joined
- Nov 14, 2005
- Messages
- 2,342
- Office Version
- 365
- Platform
- Windows
I am using this code to determine the last row and to delete data.
How can I use something like this to count how many rows there are from A3 down and then check another row (like B3) down to see if it has the same number of fields with data in it?
If I have 10 rows in column A starting from A3 down I want to check B3 down to ensure it has the same number. There should be the same number - if there isnt that means the user did not fill in all the required data and I want to trigger a message box telling them to check.
Thanks
How can I use something like this to count how many rows there are from A3 down and then check another row (like B3) down to see if it has the same number of fields with data in it?
If I have 10 rows in column A starting from A3 down I want to check B3 down to ensure it has the same number. There should be the same number - if there isnt that means the user did not fill in all the required data and I want to trigger a message box telling them to check.
Thanks
Code:
Dim lr1 As Long
'Clear existing data if any
lr1 = Sheets("Assemblies").Cells(Rows.Count, "A").End(xlUp).Row
If lr1 > 2 Then Sheets("Assemblies").Range("A3:T" & lr1).ClearContents