Ark68
Well-known Member
- Joined
- Mar 23, 2004
- Messages
- 4,658
- Office Version
- 365
- 2016
- Platform
- Windows
I have this code which drops the values of an array into a column. How can I change this so that the values, instead of a column are placed in a row (row 2) starting at AA2?
VBA Code:
Sub ExtractNamesToColumn(grp)
Dim names() As String
Dim j As Long
' Split the string into an array using the comma as a delimiter
names = Split(grp, ",")
' Loop through the array and write the names to the target column
For j = LBound(names) To UBound(names)
' Trim spaces and write each name in column AC starting at AC2
ws_dump.Cells(j + 3, "AA").Value = Trim(names(j))
Next j
End Sub