Scripts / Macros in Word and Excel
Works great! Thank you!
"Gary''s Student" wrote:
If your data is in column A, then this:
Sub mailum()
n = Cells(Rows.Count, 1).End(xlUp).Row
k = 1
For i = 1 To n
v = Cells(i, 1).Value
If InStr(v, ",") 0 Then
s = Split(v, ",")
For j = LBound(s) To UBound(s)
Cells(k, 2).Value = s(j)
k = k + 1
Next
Else
Cells(k, 2).Value = v
k = k + 1
End If
Next
End Sub
will fill column B with single email addresses
--
Gary''s Student - gsnu200828
"dleo" wrote:
Every month I send out an e-newsletter to the people in my database. To get
the addresses I simply export their information into an Excel file,
copy/paste into Word, then copy/paste them into the e-mail.
In the exporting process however, multiple e-mails may be put into the same
Excel cell (ex. "). That means every
month I have to visually look down a long list to make sure each e-mail is on
its own line.
Is there some sort of macro or script I could create to eliminate this step?
Something along the lines of "If there is a "," move the rest of the cell
contents into a new cell below".
I am new to macros/scripts, so any help would be appreciated.
Thanks!
|