Hi all,
Hoping the community can come to my rescue once again! I am attempting to create a code which does the following:
A cell will contain a value ("J12" in my example). I want to have a macro which copies this value to the next empty cell within a range ("B6:B25") if the value is not already present within the range, and once added, offset by -1 (now in the A column) and increase the value by 1. If the value is present already, I only want to offset and increase by 1.
I have acheived something very similar in this same sheet, but unfortunately it does not allow for the range to start at the 6th row as is the case here. I also do not know how to do the result for when the value is already present, or what that code would look like...
I have included the code I am failing to adjust to reflect what I need, and I really hope someone can advise!
Application.ScreenUpdating = False
Cells(12, 10).Copy
With Sheets("Sheet1").Range("B6:B25").End(xlUp).Offset(1)
.PasteSpecial (xlPasteValues)
ActiveCell.Offset(0, -1).Select
ActiveCell.Value = ActiveCell.Value + 1
End With
SendKeys ("^{HOME}")
Application.ScreenUpdating = True
Thank you in advance for any support,
Ty
Hoping the community can come to my rescue once again! I am attempting to create a code which does the following:
A cell will contain a value ("J12" in my example). I want to have a macro which copies this value to the next empty cell within a range ("B6:B25") if the value is not already present within the range, and once added, offset by -1 (now in the A column) and increase the value by 1. If the value is present already, I only want to offset and increase by 1.
I have acheived something very similar in this same sheet, but unfortunately it does not allow for the range to start at the 6th row as is the case here. I also do not know how to do the result for when the value is already present, or what that code would look like...
I have included the code I am failing to adjust to reflect what I need, and I really hope someone can advise!
Application.ScreenUpdating = False
Cells(12, 10).Copy
With Sheets("Sheet1").Range("B6:B25").End(xlUp).Offset(1)
.PasteSpecial (xlPasteValues)
ActiveCell.Offset(0, -1).Select
ActiveCell.Value = ActiveCell.Value + 1
End With
SendKeys ("^{HOME}")
Application.ScreenUpdating = True
Thank you in advance for any support,
Ty