Hi
I would like to copy range A8:J15 to a the next empty row in the same sheet.
Any ideas?
Thanks
Hi
I would like to copy range A8:J15 to a the next empty row in the same sheet.
Any ideas?
Thanks
Last edited by kaurka; 04-22-2013 at 11:02 AM.
Try this
![]()
With Worksheets("Sheet1") .Range("A8:J15").Copy .Range("A" & .Rows.Count).End(xlUp).Offset(1, 0) End With
If I have helped, Don't forget to add to my reputation (click on the star below the post)
Don't forget to mark threads as "Solved" (Thread Tools->Mark thread as Solved)
Use code tags when posting your VBA code: [code] Your code here [/code]
I forgot to mention in the range i have merged cells.
Do you have a sample that you can upload?
Also can you show us where you want the data to be pasted?
I dont have a sample i can upload.
But i would like to do the same as the code below for columns:
![]()
Sub CopyCol() Dim i As Long i = Cells(2, Columns.Count).End(xlToLeft).Column Range("E2:H30").Copy Cells(2, i + 4).PasteSpecial Paste:=xlPasteAll Application.CutCopyMode = False End Sub
Try
![]()
With Worksheets("Sheet1") .Range("A8:J15").Copy .Range("A" & .Rows.Count).End(xlUp).Offset(1, 0).pastespecial(xlpastevalues) End With
Getting an error
To do this, all the merged cells need to be the same size
My range also has all the formatting and formulas that i would like to copy
Its better you attach a sample.
See the attachment below
Issue List.xlsm
"To do this, all the merged cells need to be the same size"
The error message is: Need to unmerge cells.
I have done this before with columns. See the CODE above
I just figured it our myself but thanks for all your input.
Here's the Code:
![]()
Sub CopyRow() Dim i As Long i = Cells(Rows.Count, 1).End(xlUp).Row Range("A8:J15").Copy Cells(i + 8, 1).PasteSpecial Paste:=xlPasteAll Application.CutCopyMode = False End Sub
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks