Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- dim address_on as string 'current address
- dim names as string 'concatenate list of names
- dim in_list_already as boolean
- For address_row = 1 to range().end(xldown).row
- 'loop through addresses
- address_on = Range("Column" & address_row).value
- names = ""
- 'First check if address_on is already in destination list?
- in_list_already = false
- for check_row = 1 to range("Destination").end(xldown).row
- If range("Destination Col" & check_row).value = address_on then
- in_list_already = true
- Exit for
- End if
- next
- if in_list_already = false then
- 'Find all names that have this address
- for name_row = 1 to range().end(xldown).row
- If range("Address Column" & name_row).value = address_on then
- names = names & Range("Name Column" & name_row).value & ","
- End if
- next
- 'remove last comma
- names = names.remove(Len(names)-1,1)
- 'add to list
- Range("Column to insert to 1" & next_slot).value = names
- Range("Column to insert to 2" & next_slot).value = address_on
- End if
- next
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement