#1   Report Post  
Posted to microsoft.public.excel.misc
pcor
 
Posts: n/a
Default Concatonate

I would like very much to be able to place the cursor immediately below a
line that contains data in cols a,b,c,d,e,
Then click on a macro and that macro would concatonate all the data in the
line above into the selected cell.
Can this be done
Thanks

  #2   Report Post  
Posted to microsoft.public.excel.misc
Bob Phillips
 
Posts: n/a
Default Concatonate

This does it by selecting a cell

Private Sub Worksheet_SelectionChange(ByVal Target As Excel.Range)

On Error GoTo EndMacro
Application.EnableEvents = False
With Target
If .Row 1 Then
.Value = Cells(.Row - 1, "A").Value & Cells(.Row - 1, "B").Value
& _
Cells(.Row - 1, "C").Value & Cells(.Row - 1, "D").Value
& _
Cells(.Row - 1, "E").Value
End If
End With
EndMacro:
Application.EnableEvents = True
End Sub


'This is worksheet event code, which means that it needs to be
'placed in the appropriate worksheet code module, not a standard
'code module. To do this, right-click on the sheet tab, select
'the View Code option from the menu, and paste the code in.





--
HTH

Bob Phillips

(remove nothere from email address if mailing direct)

"pcor" wrote in message
...
I would like very much to be able to place the cursor immediately below a
line that contains data in cols a,b,c,d,e,
Then click on a macro and that macro would concatonate all the data in the
line above into the selected cell.
Can this be done
Thanks



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


Similar Threads
Thread Thread Starter Forum Replies Last Post
concatonate pcor Excel Discussion (Misc queries) 4 March 1st 06 10:32 PM


All times are GMT +1. The time now is 12:58 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"