R
ryguy7272
I have a list of names and sales revenues associated with those names. I
have names in Column B of Sheet1 and Sales figures in Column C of Sheet1. I
am hoping to be able to find a way of entering an identifier, such as an “Xâ€
into Column D of Sheet1, then have Excel lookup the name, which is in Column
B on Sheet2. I think Index/Match would work. Now, that the Name in Column B
on Sheet1 is matched with the Name in Column B on Sheet2, find where the
value changes (i.e., the name of the director changes) and copy this array
plus one Column to the right (so Sheet2, Column B and Column C) because these
are the sales reps that report to the director. I’d like to take the result
and copy/paste to a Summary Sheet. Finally, the sales revenue is in Column C
of Sheet1. I would love to be able to copy this value to the Summary Sheet
too.
Pretty complicated, but I’m sure it can be done. I’ll be up late tonight,
working on the code for this. I’ll post back with some VBA, once I make a
little progress on this. I am just posting now to see if anyone here has
some generic code that may work in this situation. I know it’s a long shot,
but I’ve seem some AMAZING things here over the past couple of years.
Finally, if I can figure this out myself, I’ll post the results. I’m not
feeling very creative at this very moment though…
I would suspect, it would start like this:
Private Sub Worksheet_Change(ByVal Target As Range)
Set r = Range("D")
Set t = Target
If Intersect(r, t) Is Nothing Then Exit Sub
If t.Value = "X" Then
Application.EnableEvents = False
'ALL CODE HERE...................................
Application.EnableEvents = True
End If
End Sub
Thanks,
Ryan---
have names in Column B of Sheet1 and Sales figures in Column C of Sheet1. I
am hoping to be able to find a way of entering an identifier, such as an “Xâ€
into Column D of Sheet1, then have Excel lookup the name, which is in Column
B on Sheet2. I think Index/Match would work. Now, that the Name in Column B
on Sheet1 is matched with the Name in Column B on Sheet2, find where the
value changes (i.e., the name of the director changes) and copy this array
plus one Column to the right (so Sheet2, Column B and Column C) because these
are the sales reps that report to the director. I’d like to take the result
and copy/paste to a Summary Sheet. Finally, the sales revenue is in Column C
of Sheet1. I would love to be able to copy this value to the Summary Sheet
too.
Pretty complicated, but I’m sure it can be done. I’ll be up late tonight,
working on the code for this. I’ll post back with some VBA, once I make a
little progress on this. I am just posting now to see if anyone here has
some generic code that may work in this situation. I know it’s a long shot,
but I’ve seem some AMAZING things here over the past couple of years.
Finally, if I can figure this out myself, I’ll post the results. I’m not
feeling very creative at this very moment though…
I would suspect, it would start like this:
Private Sub Worksheet_Change(ByVal Target As Range)
Set r = Range("D")
Set t = Target
If Intersect(r, t) Is Nothing Then Exit Sub
If t.Value = "X" Then
Application.EnableEvents = False
'ALL CODE HERE...................................
Application.EnableEvents = True
End If
End Sub
Thanks,
Ryan---