My code is testing values in column E: So if it meets a criteria(a unique part), it creates a new tab within the worksheet. When it meets the criteria, I would like the code to copy the value in column G: of the same row to the tab it just created. The code I have is below. I have tried using the offset(0,2) property, but no luck...THANKS!
For Each cell In Sheets(1).Range("E2:E140")
If cell.Value <> cell.Offset(-1, 0).Value Then
Selection.Offset(0, 2).Select
Selection.Copy
Sheets.Add , Sheets(Sheets.Count)
Sheets(Sheets.Count).Name = cell.Value
ActiveSheet.Select
ActiveSheet.Paste
End If
Next cell
For Each cell In Sheets(1).Range("E2:E140")
If cell.Value <> cell.Offset(-1, 0).Value Then
Selection.Offset(0, 2).Select
Selection.Copy
Sheets.Add , Sheets(Sheets.Count)
Sheets(Sheets.Count).Name = cell.Value
ActiveSheet.Select
ActiveSheet.Paste
End If
Next cell