close

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
ThanksThis 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 gt; 1 Then
.Value = Cells(.Row - 1, quot;Aquot;).Value amp; Cells(.Row - 1, quot;Bquot;).Value
amp; _
Cells(.Row - 1, quot;Cquot;).Value amp; Cells(.Row - 1, quot;Dquot;).Value
amp; _
Cells(.Row - 1, quot;Equot;).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)

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

arrow
arrow
    全站熱搜
    創作者介紹
    創作者 software 的頭像
    software

    software

    software 發表在 痞客邦 留言(0) 人氣()