To Export Text Box Content In To Excel

raindrop
Lounger
Posts: 36
Joined: 04 Feb 2013, 06:22

To Export Text Box Content In To Excel

Post by raindrop »

Hi,
I Want Java script or any code for button to export text content separated by comma situated in text box of web page in to excel in transposed state as it is in attached image.
Any Help ?

Thanks
Raindrop
You do not have the required permissions to view the files attached to this post.

User avatar
Rudi
gamma jay
Posts: 25455
Joined: 17 Mar 2010, 17:33
Location: Cape Town

Re: To Export Text Box Content In To Excel

Post by Rudi »

If you copy the contents of the textbox to the clipboard, you can run this code from Excel.
It should paste the clipboard data to cell A1 and then either transpose it or split it as per the macro below...

Code: Select all

Sub PasteAndSplit()
    Application.ScreenUpdating = False
    ActiveSheet.PasteSpecial Format:="Text"
    Columns("A:A").TextToColumns Destination:=Range("A1"), DataType:=xlDelimited, _
        TextQualifier:=xlDoubleQuote, ConsecutiveDelimiter:=False, Tab:=False, _
        Semicolon:=False, Comma:=True, Space:=False, Other:=False, FieldInfo _
        :=Array(Array(1, 1), Array(2, 1), Array(3, 1)), TrailingMinusNumbers:=True
    Rows(1).Copy
    Range("A2").PasteSpecial Paste:=xlPasteAll, Transpose:=True
    Application.CutCopyMode = False
    Rows("1:1").Delete Shift:=xlUp
    Cells.EntireColumn.AutoFit
    Range("A1").Select
    Application.ScreenUpdating = False
End Sub

Sub PasteAndTranspose()
    Application.ScreenUpdating = False
    ActiveSheet.PasteSpecial Format:="Text"
    Rows(1).Copy
    Range("A2").PasteSpecial Paste:=xlPasteAll, Transpose:=True
    Application.CutCopyMode = False
    Rows("1:1").Delete Shift:=xlUp
    Cells.EntireColumn.AutoFit
    Range("A1").Select
    Application.ScreenUpdating = False
End Sub
Regards,
Rudi

If your absence does not affect them, your presence didn't matter.

raindrop
Lounger
Posts: 36
Joined: 04 Feb 2013, 06:22

Re: To Export Text Box Content In To Excel

Post by raindrop »

Thank You Rudi Sir, Actually I Wanted To Export Direct From Web Page To Excel Just By Single Click On Button Provided On Web Page. Well.. For Time Being I Would Like To Use Code You Provided.Thanks Again For Your Kind Help.

User avatar
Rudi
gamma jay
Posts: 25455
Joined: 17 Mar 2010, 17:33
Location: Cape Town

Re: To Export Text Box Content In To Excel

Post by Rudi »

Hi Raindrop,

I'm unfortunately not familiar with Java Scripts or HTML coding and cannot assist with a one click solution. Maybe someone else who is more knowledgeable on web programming can assist in that regard.
Regards,
Rudi

If your absence does not affect them, your presence didn't matter.