#1   Report Post  
Posted to microsoft.public.excel.misc
pcor
 
Posts: n/a
Default 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   Report Post  
Posted to microsoft.public.excel.misc
R..VENKATARAMAN
 
Posts: n/a
Default concatonate

use event macro
worksheet_selectionchang
under this write your macro

"pcor" wrote in message
...
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   Report Post  
Posted to microsoft.public.excel.misc
Gord Dibben
 
Posts: n/a
Default 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"
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   Report Post  
Posted to microsoft.public.excel.misc
pcor
 
Posts: n/a
Default 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"
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   Report Post  
Posted to microsoft.public.excel.misc
Gord Dibben
 
Posts: n/a
Default concatonate

Happy to have been of assistance.

Gord

On Wed, 1 Mar 2006 14:14:29 -0800, "pcor"
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"
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
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 07:28 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"