• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 915
  • Last Modified:

Create Delimited String that will paste into excel

in vb.net, what I want to do is lets say my string exists as

200, 300, 400, 5000, 6000

I am thinking I have created a comma deliminated string. The next step is to copy it to the clipboard so that the user can go and copy paste these values into notepad or excel.
The problem is if they go into excel it goes and pastes all the values into one cell it appears all in one cell.

Thanks for any help.
0
scorpion53061
Asked:
scorpion53061
1 Solution
 
Christopher KileCommented:
You have created a comma-delimited string, but Excel imports comma-delimited strings from FILES, not from the Paste buffer.

I don't know if Dynamic Data Exchange (DDE) is still supported, but that technology allowed what you are trying to do - however, it was not for the faint of heart.
0
 
scorpion53061Author Commented:
well I do know if I replace the comma with a tab it will do what I am seeking. There shoudl be a way to do it with the comma.
0
 
joechinaCommented:
When I copy a delimited string to Excel, I get a little hint to let me select Text Import Wizard...
Your string looks fine to me.
0
 
Mike TomlinsonMiddle School Assistant TeacherCommented:
"well I do know if I replace the comma with a tab it will do what I am seeking."

So replace the Commas with Tabs...    =O

        Dim data As String = "200, 300, 400, 5000, 6000"
        Clipboard.SetText(data.Replace(", ", ",").Replace(",", vbTab))

"There shoudl be a way to do it with the comma."

Why "should" it work with a comma?...
0
 
Christopher KileCommented:
dunno about the asker, but I've just learned a few things about Excel that I'd completely forgotten...apologies for earlier bad advice and thanks to others for better suggestions....
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: MCSA MCSE Windows Server 2012

This course teaches how to install and configure Windows Server 2012 R2.  It is the first step on your path to becoming a Microsoft Certified Solutions Expert (MCSE).

Tackle projects and never again get stuck behind a technical roadblock.
Join Now