+ Reply to Thread
Results 1 to 5 of 5

concatonate

  1. #1
    pcor
    Guest

    concatonate

    I think I need a macro ....
    I would like to be able to place my cursor anywhere on the spreadsheet and
    then click a macro that would concatonate all the data on the line
    immediately above where the cursor is loctaed,
    IE
    If I place the cursor on line a14 I would want to concatonate all the data
    on line 13 from a13 to e13
    Need help...and thanks
    PCOR

  2. #2
    R..VENKATARAMAN
    Guest

    Re: concatonate

    use event macro
    worksheet_selectionchang
    under this write your macro

    "pcor" <[email protected]> wrote in message
    news:[email protected]...
    >I think I need a macro ....
    > I would like to be able to place my cursor anywhere on the spreadsheet and
    > then click a macro that would concatonate all the data on the line
    > immediately above where the cursor is loctaed,
    > IE
    > If I place the cursor on line a14 I would want to concatonate all the
    > data
    > on line 13 from a13 to e13
    > Need help...and thanks
    > PCOR




  3. #3
    Gord Dibben
    Guest

    Re: concatonate

    pcor

    Perhaps you can adapt this macro to suit.

    Sub ConCat_Cells()
    Dim x As Range
    Dim y As Range
    Dim z As Range
    Dim w As String
    Dim sbuf As String
    On Error GoTo endit
    w = InputBox("Enter the Type of De-limiter Desired")
    Set z = Application.InputBox("Select Destination Cell", _
    "Destination Cell", , , , , , 8)
    Application.SendKeys "+{F8}"
    Set x = Application.InputBox("Select Cells...Contiguous or Non", _
    "Cells Selection", , , , , , 8)
    For Each y In x
    If Len(y.text) > 0 Then sbuf = sbuf & y.text & w
    Next
    z = Left(sbuf, Len(sbuf) - 1)
    Exit Sub
    endit:
    MsgBox "Nothing Selected. Please try again."
    End Sub


    Gord Dibben MS Excel MVP


    On Tue, 28 Feb 2006 16:49:28 -0800, "pcor" <[email protected]>
    wrote:

    >I think I need a macro ....
    >I would like to be able to place my cursor anywhere on the spreadsheet and
    >then click a macro that would concatonate all the data on the line
    >immediately above where the cursor is loctaed,
    >IE
    >If I place the cursor on line a14 I would want to concatonate all the data
    >on line 13 from a13 to e13
    >Need help...and thanks
    >PCOR



  4. #4
    pcor
    Guest

    Re: concatonate

    works VERY well Thanks


    "Gord Dibben" wrote:

    > pcor
    >
    > Perhaps you can adapt this macro to suit.
    >
    > Sub ConCat_Cells()
    > Dim x As Range
    > Dim y As Range
    > Dim z As Range
    > Dim w As String
    > Dim sbuf As String
    > On Error GoTo endit
    > w = InputBox("Enter the Type of De-limiter Desired")
    > Set z = Application.InputBox("Select Destination Cell", _
    > "Destination Cell", , , , , , 8)
    > Application.SendKeys "+{F8}"
    > Set x = Application.InputBox("Select Cells...Contiguous or Non", _
    > "Cells Selection", , , , , , 8)
    > For Each y In x
    > If Len(y.text) > 0 Then sbuf = sbuf & y.text & w
    > Next
    > z = Left(sbuf, Len(sbuf) - 1)
    > Exit Sub
    > endit:
    > MsgBox "Nothing Selected. Please try again."
    > End Sub
    >
    >
    > Gord Dibben MS Excel MVP
    >
    >
    > On Tue, 28 Feb 2006 16:49:28 -0800, "pcor" <[email protected]>
    > wrote:
    >
    > >I think I need a macro ....
    > >I would like to be able to place my cursor anywhere on the spreadsheet and
    > >then click a macro that would concatonate all the data on the line
    > >immediately above where the cursor is loctaed,
    > >IE
    > >If I place the cursor on line a14 I would want to concatonate all the data
    > >on line 13 from a13 to e13
    > >Need help...and thanks
    > >PCOR

    >
    >


  5. #5
    Gord Dibben
    Guest

    Re: concatonate

    Happy to have been of assistance.

    Gord

    On Wed, 1 Mar 2006 14:14:29 -0800, "pcor" <[email protected]>
    wrote:

    >works VERY well Thanks
    >
    >
    >"Gord Dibben" wrote:
    >
    >> pcor
    >>
    >> Perhaps you can adapt this macro to suit.
    >>
    >> Sub ConCat_Cells()
    >> Dim x As Range
    >> Dim y As Range
    >> Dim z As Range
    >> Dim w As String
    >> Dim sbuf As String
    >> On Error GoTo endit
    >> w = InputBox("Enter the Type of De-limiter Desired")
    >> Set z = Application.InputBox("Select Destination Cell", _
    >> "Destination Cell", , , , , , 8)
    >> Application.SendKeys "+{F8}"
    >> Set x = Application.InputBox("Select Cells...Contiguous or Non", _
    >> "Cells Selection", , , , , , 8)
    >> For Each y In x
    >> If Len(y.text) > 0 Then sbuf = sbuf & y.text & w
    >> Next
    >> z = Left(sbuf, Len(sbuf) - 1)
    >> Exit Sub
    >> endit:
    >> MsgBox "Nothing Selected. Please try again."
    >> End Sub
    >>
    >>
    >> Gord Dibben MS Excel MVP
    >>
    >>
    >> On Tue, 28 Feb 2006 16:49:28 -0800, "pcor" <[email protected]>
    >> wrote:
    >>
    >> >I think I need a macro ....
    >> >I would like to be able to place my cursor anywhere on the spreadsheet and
    >> >then click a macro that would concatonate all the data on the line
    >> >immediately above where the cursor is loctaed,
    >> >IE
    >> >If I place the cursor on line a14 I would want to concatonate all the data
    >> >on line 13 from a13 to e13
    >> >Need help...and thanks
    >> >PCOR

    >>
    >>


    Gord Dibben MS Excel MVP

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1