mardi 29 janvier 2019

Categorizing using an IF Then Function with non-numerical values

I am trying to wring a code to automated categorization of natural and induced fractured by fracture type in a data sheet. I am trying to use an If Then function for fracture types that are known to be Induced fractures rather than naturally occurring ones. I have tried two different ways of getting this categorization to work for even a single type by I keep getting compiling errors and syntax errors. Is there a better way to go about this sort of problem?

Sub Simple_if()
    If Range(G4, [G1004]) = "Twist" Then Range(I4, [I1004]) = "Induced"
    End If

Also have tried

 Dim G As Integer
 For G = 4 To 1004

and

 Dim I As Integer
 For I = 4 To 1004
    If Cells(G, 5).Value = "Twist" Then Cells(I, 5).Value = "Induced"

Aucun commentaire:

Enregistrer un commentaire