oscarmiike
New Member
- Joined
- Apr 24, 2018
- Messages
- 3
Hi all,
I'm a bit of a rookie and can't figure out how to add another IF to this code below.
Sheets("CORE").Range("A1") is referring to a date.. and if that date can't be found in the ActiveSheet.Range("A1:A100"), I would like it to do nothing, no next.
I would also like to not use something like "Then End Sub".. as there are other similar bits of code like this one in the same sub, doing the same sort of job.
Many thanks!!
OM.
I'm a bit of a rookie and can't figure out how to add another IF to this code below.
Sheets("CORE").Range("A1") is referring to a date.. and if that date can't be found in the ActiveSheet.Range("A1:A100"), I would like it to do nothing, no next.
I would also like to not use something like "Then End Sub".. as there are other similar bits of code like this one in the same sub, doing the same sort of job.
Code:
Sheets("XAUXAG-R").Select
For Each Cell In ActiveSheet.Range("A1:A100")
If Cell.Value = Sheets("CORE").Range("A1") Then
Cell.Resize(1, 5).Copy
End If
Next
Sheets("XAUXAG").Select
Range("A1").End(xlDown).Offset(1, 0).PasteSpecial Paste:=xlPasteValues
Many thanks!!
OM.