I currently comma delimit using this and put it to the clipboard using MSForms.DataObject
Dim ConvertComma
ConvertComma = Join(Application.Transpose(Selection.Value), ", ")
Dim clipboard As MSForms.DataObject
Set clipboard = New MSForms.DataObject
clipboard.SetText ConvertComma
clipboard.PutInClipboard
The issue is that this includes hidden cells. When I attempt to fix this by adding SpecialCells(xlCellTypeVisible) in the Selection.value this creates multiple selections and I get an error.
I'm needing to either store the multiple ranges as 1 range without pasting it in the work sheet or to adjust the code to accept multiple selections.
I've attempted this which has allowed me to make multiple selections however it's pasting over existing data and only storing 1 of the selections.
Dim ConvertComma
Dim myarray As Variant
myarray = Selection
Selection.Value = myarray
ConvertComma = Join(Application.Transpose(myarray), ", ")
MSForms requires turning on features in the Library so if this isn't done that section can be replaced with a msg box for troubleshooting.
Dim ConvertComma
ConvertComma = Join(Application.Transpose(Selection.Value), ", ")
Dim clipboard As MSForms.DataObject
Set clipboard = New MSForms.DataObject
clipboard.SetText ConvertComma
clipboard.PutInClipboard
The issue is that this includes hidden cells. When I attempt to fix this by adding SpecialCells(xlCellTypeVisible) in the Selection.value this creates multiple selections and I get an error.
I'm needing to either store the multiple ranges as 1 range without pasting it in the work sheet or to adjust the code to accept multiple selections.
I've attempted this which has allowed me to make multiple selections however it's pasting over existing data and only storing 1 of the selections.
Dim ConvertComma
Dim myarray As Variant
myarray = Selection
Selection.Value = myarray
ConvertComma = Join(Application.Transpose(myarray), ", ")
MSForms requires turning on features in the Library so if this isn't done that section can be replaced with a msg box for troubleshooting.