bananacuriel
New Member
- Joined
- Feb 19, 2018
- Messages
- 2
Ive been having troubles looping mi script into the entire column. it looks like this
Sub if_veracruz()
Dim score1 As Integer, score2 As Integer, result As String
score1 = Range("F2").Select
score2 = Range("h2").Select
If score1 = 30 And score2 <= 5 Or score2 = 8 Or score2 = 10 Then
result = "Veracruz Norte"
Else
result = "Veracruz Sur"
End If
Range("G2").Value = result
i thought i could add something like this
Dim x As Integer
Application.ScreenUpdating = False
' Set numrows = number of rows of data.
NumRows = Range("g2", Range("g2").End(xlDown)).Rows.Count
' Select cell g2.
Range("g2").Select
' Establish "For" loop to loop "numrows" number of times.
For x = 1 To NumRows
'code here
' Selects cell down 1 row from active cell.
ActiveCell.Offset(1, 0).Select
Next
Application.ScreenUpdating = True
End Sub
but when trying to join them it only appears error...please help
Sub if_veracruz()
Dim score1 As Integer, score2 As Integer, result As String
score1 = Range("F2").Select
score2 = Range("h2").Select
If score1 = 30 And score2 <= 5 Or score2 = 8 Or score2 = 10 Then
result = "Veracruz Norte"
Else
result = "Veracruz Sur"
End If
Range("G2").Value = result
i thought i could add something like this
Dim x As Integer
Application.ScreenUpdating = False
' Set numrows = number of rows of data.
NumRows = Range("g2", Range("g2").End(xlDown)).Rows.Count
' Select cell g2.
Range("g2").Select
' Establish "For" loop to loop "numrows" number of times.
For x = 1 To NumRows
'code here
' Selects cell down 1 row from active cell.
ActiveCell.Offset(1, 0).Select
Next
Application.ScreenUpdating = True
End Sub
but when trying to join them it only appears error...please help