Macro check if specific values in specific rows and columns

Nody224

New Member
Joined
Dec 8, 2022
Messages
5
Office Version
  1. 2013
Platform
  1. Windows
I need some help as I don't think I can record a macro that would do what I need to do.

The macro which I wanna code would: Verify in column J if column contains a "x" text value or a date or the text value "ANOM" the x value means not treated, the date means it has been treated and ANOM means missing values.

The macro would check row by row

  • if column K contains 6 digits,
  • if column E contains some specific text values
  • if column N contain 3 digits
  • if column X;Y;Z;AA;AB;AC;AD;AE;AF;AG;AH;AI;AJ;AK contain specifif values either some string of character of a range of values for example 10-20; 20-30
  • if column AZ contains a Date in specific format
If rows have been treated then put today's date in column J for the corresponding row, if there are missing value put ANOM

Then at the end if I rerun the macro if all rows are treated call a message box which states all rows have been treated (if no ANOM) and if there are ANOM call a message Box which states ANOM some rows are missing values.

Please, I would appreciate some help as I'm trying to figure out how to do this. Thanks

I tried recording a macro but doesn't help. I'm using excel 2013.
 

Excel Facts

Wildcard in VLOOKUP
Use =VLOOKUP("Apple*" to find apple, Apple, or applesauce
When do you want the check to take place? When an entry is made in K E N etc or once all are entered?
 
Upvote 0
So for each row check the columns?
 
Upvote 0
Yes, for each row check the corresponding cell in the column
 
Upvote 0
Something on the line of

VBA Code:
Dim RLoop As Long
Dim LastRow As Long

Sub InfoCheck()
LastRow = ActiveSheet.Cells(Rows.Count, "K").End(xlUp).Row

For RLoop = 1 To LastRow
    If ActiveSheet.Cells(RLoop, "K").Value > 99999 And ActiveSheet.Cells(RLoop, "K").Value <= 999999 Then
        If ActiveSheet.Cells(RLoop, "E").Value = "xyz" Then
            If ActiveSheet.Cells(RLoop, "N").Value > 99 And ActiveSheet.Cells(RLoop, "N").Value <= 999 Then
                ' Do domething
            End If
        End If
    End If
Next
End Sub
 
Upvote 0

Forum statistics

Threads
1,215,066
Messages
6,122,948
Members
449,095
Latest member
nmaske

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top