ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Need help copying certain cells from current row (https://www.excelbanter.com/excel-programming/415215-need-help-copying-certain-cells-current-row.html)

jonco

Need help copying certain cells from current row
 
I want to be able to select contents of cells in columns B thru E in the
current row (the row where the cursor is in) and then paste that info
into cells row 2 coulmn F thru I. Then place the cursor back in the
next row after the original row.

Sounds easy, but it's not for me. Any help would be appreciated.

Jonco

Barb Reinhardt

Need help copying certain cells from current row
 
Assuming you want to paste the data in the same row as the current row.

Sub CurrentRow() '
'I want to be able to select contents of cells in columns B thru E in the
'current row (the row where the cursor is in) and then paste that info
'into cells row 2 coulmn F thru I. Then place the cursor back in the
'next row after the original row.

Dim aWS As Worksheet
Dim myRow As Long
Dim myRange As Range

Set aWS = ActiveSheet
myRow = Selection.Row
Set myRange = aWS.Cells(myRow, 2).Resize(1, 4)
myRange.Offset(0, 4).Value = myRange.Value
aWS.Cells(myRange.Row + 1, myRange.Column).Select


End Sub

--
HTH,
Barb Reinhardt



"Jonco" wrote:

I want to be able to select contents of cells in columns B thru E in the
current row (the row where the cursor is in) and then paste that info
into cells row 2 coulmn F thru I. Then place the cursor back in the
next row after the original row.

Sounds easy, but it's not for me. Any help would be appreciated.

Jonco


FSt1

Need help copying certain cells from current row
 
hi
another way.
Sub copyit()
Dim r As Range
Set r = ActiveCell
Range(r, r.Offset(0, 4)).Copy Destination:=Range("F2")
r.Offset(1, 0).Select
End Sub

regards
FSt1


"Jonco" wrote:

I want to be able to select contents of cells in columns B thru E in the
current row (the row where the cursor is in) and then paste that info
into cells row 2 coulmn F thru I. Then place the cursor back in the
next row after the original row.

Sounds easy, but it's not for me. Any help would be appreciated.

Jonco



All times are GMT +1. The time now is 03:48 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com