Hey all, I hate to be that guy that joins a forum and immediately posts a problem but I've been researching this issue for a few days now and can't figure it out.
The user will enter image URLs into a single cell in a "Master" workbook. If there are more then one URL they must be separated by commas(,). When they hit the compile data macro button, I need it to 1) check if there is more then one URL, 2) (Assuming there is more then one URL) copy all text in the Master cell up to each comma, and 3) paste that text segment into incrementing cells in another workbook(the first string goes to column BE, the second to BF, etc, up to a max of six to BJ). This must be done for every cell in the column.
Thoughts?
EDIT: Thanks to Leith, this has been solved, here is the final code:
Sub CopyURLs()
Dim Cell As Range
Dim DstRng As Range
Dim DstWkb As Workbook
Dim R As Long
Dim RngEnd As Range
Dim ScrRng As Range
Dim SrcWkb As Workbook
Dim URLs As Variant
Set SrcWkb = Workbooks("Master_Template")
Set DstWkb = Workbooks("Sears_Addon_Template")
Set SrcRng = SrcWkb.Worksheets("Master Sheet").Range("A2")
Set DstRng = DstWkb.Worksheets("Data Format").Range("BE2")
Set RngEnd = SrcRng.Parent.Cells(Rows.Count, SrcRng.Column).End(xlUp)
If RngEnd.Row < SrcRng.Row Then Exit Sub Else Set SrcRng = SrcRng.Parent.Range(SrcRng, RngEnd)
For Each Cell In SrcRng
If Cell <> "" Then
URLs = Split(Cell, ",")
DstRng.Offset(R, 0).Resize(1, UBound(URLs) + 1).Value = URLs
R = R + 1
End If
Next Cell
End Sub
Bookmarks