View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 27,285
Default Find last real row of filterred data table

Dim rng as Range
With Worksheets("Project Log Form)
if .AutofilterMode and .FilterMode then
set rng = .Autofilter.Range
set rng = rng.offset(rng.rows.count,0).Resize(1,1)
set rng = .cells(rng.row,1)
else
set rng = .Cells(rows.count,1).End(xlup)
End if
End With
Worksheets("Dialog11").Range("A2"AA2").copy _
Destination:=rng

--
Regards,
Tom Ogilvy

"andibevan " wrote in message
...
Hi all,

I am using the the following code to copy data to the bottom of a data
table:-

Worksheets("Dialog11").Range("A2:AA2").Copy _
Destination:=Worksheets("Project Log Form").Cells(Rows.Count,
1).End(xlUp)(2)

Problem is that this code works fine when the autofilters are not
applied but if a filter is set the code copies the data to the last
visible row.

Does anyone have any clues on how to add the data to the real last
row.

If it makes life easier, each data entry has a unique ID in column B
and the highest ID number is always located in the last real row.

Any help would be greatfully received.

Ta

Andi


---
Message posted from http://www.ExcelForum.com/