I'm new to VBA programming and am having an absolutely insanely difficult time understanding how to put these concepts together.
My goal is to select multiple rows (that have multiple strings in each column) based on criteria, such as "If the values in column h are less than 50%, copy entire rows with such criteria and move to a new sheet called, 'less than 50'. If the values in column h are over 70%, copy entire rows and move to a new sheet called 'over 70%'. if values in column h are in between 50-70%, move to a sheet called in between."
I've tried for weeks looking at tutorials and other information and just can't figure it out.
None of this works but this is pretty much the things I've learned over the last couple of weeks, and where I'm trying to go with my code.
Sub cool()
i As Integer
For i = 2 To Number
If Cells(i, 3).Value < 50 Then
activecells.Rows().EntireRow.Copy
Worksheets.Add(After:=Worksheets(Worksheets.Count)).Name = under50
Worksheets("under50").Range("A" & Rows.Count).End(xlUp).Offset(1).Select
End If
Next i
End Sub
Here is a major rewrite of your code, that will hopefully do what you want. I have included some comments explaining what I changed, but once I got to the
If
statement it became too different to the original code to continue adding many comments.