ok. vba newbie...
i want to select and entire row in excel in sheet 1, and paste the entire row into sheet 2. (2 different worksheets in the same workbook)
what code do i need to do this?
ok. vba newbie...
i want to select and entire row in excel in sheet 1, and paste the entire row into sheet 2. (2 different worksheets in the same workbook)
what code do i need to do this?
you first need to decide on which row - it could be the active cell row, or you could specify a cell
for the active cell row
sheets("sheet1").activate
activecell.entirerow.copy sheets("sheet2").cells(A,1)
for the specified cell case
sheets("sheet1").activate
Cells(B,C).entirerow.copy sheets("sheet2").cells(A,1)
in both cases, A is the row number on sheet2 where you want to paste it
in the latter case, B is the row number and C is the column number of the cell for the row you want to copy
not a professional, just trying to assist.....
can i use something like:
rows() to select the row to copy and paste?
you can either select a cell using the cursor in which it becomes the active cell, or you can specify it in the macro. A third aproach would be if you wanted the last row of data (asuming <60000 rows of data)- then
cells(60000,1).end(xlup).entirerow.copy
thanks. it worked!
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks