Need help creating data strings from a list of values inside of a worksheet.

xoenix

New Member
Joined
Feb 17, 2015
Messages
15
This forum has been extremely helpful to me in the past. I'm hoping someone can help me with the following. I'm trying to create a workbook in which a user can dump a list of email addresses in A2:A9999; press a Macro button and have that list translated into a data string in worksheet 2. For example, worksheet 1 has email addresses in A2:A10. After pressing the macro button, these email addresses are displayed as a string in Sheet 2, A1 (test1@email.com; test2@email.com; test3@email.com; etc.). A semi-colon and one space must be used as a separator. I've tried using the concatenate function and was able to generate the string. However, using the concatenate function produced zeros in the data string - carried over from those column entries in sheet 1 which did not have an email address. Anyone have any ideas how I can accomplish this? Any help would be appreciated. Thanks.
 

Excel Facts

Fastest way to copy a worksheet?
Hold down the Ctrl key while dragging tab for Sheet1 to the right. Excel will make a copy of the worksheet.
Try:-
Code:
Dim Rng As Range
With Sheets("Sheet1")
    Set Rng = .Range(.Range("A2"), .Range("A" & Rows.Count).End(xlUp))
End With
Sheets("Sheet2").Range("A1").Value = Join(Application.Transpose(Rng), "; ")
 
Upvote 0

Forum statistics

Threads
1,216,079
Messages
6,128,687
Members
449,464
Latest member
againofsoul

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top