Blank Row

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I need to paste data from one worksheet into another. The copying of the data
is not the issue. How do I determine the location of the first blank cell in
a Column A to paste the data?
 
you can either look down from the top or, better yet, from the bottom up
nr=cells("a2").end(xldown).row+1
lr=cells(rows.count,"a").end(xlup).row+1
 
Dan

Sub findbottom()
Set rng1 = ActiveSheet.Cells(Rows.Count, 1).End(xlUp) _
.Offset(1, 0)
Worksheets("Sheet2").Range("A1:J10").Copy _
Destination:=rng1
End Sub


Gord Dibben MS Excel MVP
 
When executed I get a Run-time error '13': Type mismatch

Here is a part of the code:
Set VMM_Workbook_C = ActiveWorkbook
Rows("6:6").Select
Range(Selection, Selection.End(xlDown)).Select
Selection.Copy
Set VMM_Workbook_B = ActiveWorkbook

nr = Cells("a2").End(xlDown).Row + 1

** With this location I want to paste the copied information above **

ActiveSheet.Paste
Range("A1").Select
Application.CutCopyMode = False
Rows("6:6").Select
Range(Selection, Selection.End(xlDown)).Select
Selection.Sort Key1:=Range("B6"), Order1:=xlAscending, Key2:=Range("E6") _
, Order2:=xlAscending, Header:=xlGuess, OrderCustom:=1, MatchCase:= _
False, Orientation:=xlTopToBottom, DataOption1:=xlSortNormal,
DataOption2 _
:=xlSortTextAsNumbers

Thanks
 
The two worksheets both have data. I am looking to combine the data into a
single file.

The data in the Active worksheet starts at row 6 (but I do not know the
end). The destination sheet, where I want to paste the data, I do not know
the location of the first available blank row. It could be line 590, 750, etc.

Thanks
 
You said the copying was not the issue.

I showed you how to find the first blank row in column A on the ActiveSheet and
paste to that cell.

What you copy to that destination is what you have previously copied and have on
the clipboard.

The (Sheet2").Range("A1:J10") is just an example of a range to copy to first
blank cell.


Gord
 
This was due to the error I receive when I execute the commands. The error is:
Run-time error '1004'
Application-defined or object-defined error

Dan
 
Dan

What are you referring to when you say "This was due to the error I receive when
I execute the commands"?

What is "this"?

Which commands? I must be missing part(s) of this thread.


Gord
 
Back
Top