Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Copy and Paste problem where data dissappears! 1

Status
Not open for further replies.

advox1

Technical User
Nov 28, 2003
26
0
0
GB
Hi

I am trying to copy data from one sheet to another using VBA. However when I have copied the data and move to the sheet I want to paste into I first have to find the first blank row.

When this has been done and I ask for the data to paste it has dissappeared.

Does anyone have a solution for this?

Thanks

Joanne
 
please post the code you are using - I would suggest tha you should use a construct like this though

lRow = sheets("SheetToCopyTo").range("A65536").end(xlup).row

Sheets("SheetToCopyFrom").range("CopyRange").copy destination:= sheets("SheetToCopyTo").range("A" & lRow)

Rgds, Geoff
[blue]Si hoc signum legere potes, operis boni in rebus Latinus alacribus et fructuosis potiri potes![/blue]
Want the [red]best[/red] answers to your questions ? faq222-2244
 
Thanks

The code I am using is below, however I cannot use the xlup as the data has to start from cell A28 and search down from that point for the next blank row.

Also I have previously filtered the info on the Jan 04 sheet so I am prob only copying a max of 10 rows of data.


Sheets("SEARCH").Select
Range("A28").Select
nrow = 1
Do Until ActiveCell.Value = ""
ActiveCell.Offset(1, 0).Select
nrow = nrow + 1
Loop
ActiveCell.Select
Sheets("jan 04").Select
Range("A2:N801").Select
Selection.Copy
Sheets("search").Select
Selection.Paste

Any help would be appreciated.

Thanks

 
Thanks xlbo

I have modified what you gave me and it now works a treat!

Jo
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top