View Single Post
  #6   Report Post  
Posted to microsoft.public.excel.programming
Bob Phillips[_5_] Bob Phillips[_5_] is offline
external usenet poster
 
Posts: 620
Default CurrentRegion.copy maybe?

Hiya Stephen,

Okay, let's try this

Dim sourceRange As Range
Dim destrange As Range
Dim Firstcell As String
Dim cCols As Long, cRows As Long
Firstcell = Sheets("Input").Cells(1, 1).Value
cCols = Worksheets("Input").Cells(3, Columns.Count).End(xlToLeft).Column
cRows = Worksheets(Firstcell).Cells(Rows.Count, "A").End(xlUp).Row
If Not IsEmpty(Worksheets(Firstcell).Cells(cRows, "A").Value) Then
cRows = cRows + 1
End If
Set sourceRange = Sheets("Input").Range("A3").Resize(1, cCols)
sourceRange.copy Destination:=Worksheets(Firstcell).Cells(cRows, "A")

--

HTH

Bob Phillips

"Ste_uk" wrote in message
...
Hiya Bob,

The code now works fine as requested,
But there is just one more issue I cannot work out....

I assume the code looks for the first empty row and inserts the data,
What I am trying to achieve is that the code looks for the first empty
cell in Column A and then inserts the data in that row.

I know I am pushing it (hopefully not too far) with this post but this
would definitely be the last question on this subject.

As always any help would be greatly appreciated,

Kind Regards
Stephen.