Trying to see if I can even create a Macro! Please help!
Closed
almacgtz
Posts
2
Registration date
Friday January 16, 2015
Status
Member
Last seen
January 21, 2015
-
Jan 16, 2015 at 03:11 PM
RayH - Jan 21, 2015 at 03:57 PM
RayH - Jan 21, 2015 at 03:57 PM
Related:
- Trying to see if I can even create a Macro! Please help!
- Create skype account with gmail - Guide
- Create snapchat account - Guide
- Create hotmail account - Guide
- Create instagram account on pc - Guide
- Create samsung account - Guide
1 response
Give this a go.
Sub copystudents()
Let LastRowH = Range("H" & Rows.Count).End(xlUp).Row
Let LastRowA = Range("A" & Rows.Count).End(xlUp).Row
For Each c In Range("H3:H" & LastRowH)
On Error GoTo notfound
x = Rows(Application.Match(c.Value, Range("A1:A" & LastRowA), 0)).Row
Range(c.Address & ":L" & c.Row).Copy Destination:=Range("A" & x & ":E" & x)
notfound:
Next
End Sub
Jan 21, 2015 at 11:55 AM
The code worked perfectly fine; however, if a student number is already on the left side is there any way to highlight the information on the right side without replacing the information on the left side.
Best regards,
Alma Gtz
Jan 21, 2015 at 03:57 PM
I am highlighting in red where the value on the right is not found.
For any others the colors stay as they are.