LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Please Help Correct my code


I have a bunch of files. Data format is common in all files. It looks
like this:

Col.A ColB Col C Col D Col E

empty Data Data Data Data (this goes on until about
200 rows)

then Col A has "Ave" written and it averages in all other cols.

I have written a code to find "Ave" in col A. and copy data from one
row above up untill row one. Then go to sheet "DataAll" find last row
and paste the data.

Here is my code:

Sub mycode1()

Dim rRng As Range

rRng =
Worksheets(Sheet1.Range("A:E").Find("Ave")(A).End( xlUp)).Resize(,
5).Copy
Application.Goto Worksheets("DataAll")
Set rRng = DataAll.Range("a1:A" & Range("A" &
Rows.Count).End(xlUp).Row)

With rRng.Offset(rRng.Count, 1).Resize(1, 4).Select
ActiveSheet.paste
Selection.PasteSpecial paste:=xlValues, Operation:=xlNone, SkipBlanks:=
_
False, Transpose:=False


End With


End Sub

It gives me 400 error.

Appreciate help.

Thank you
Syed


--
saziz
------------------------------------------------------------------------
saziz's Profile: http://www.excelforum.com/member.php...fo&userid=6350
View this thread: http://www.excelforum.com/showthread...hreadid=493922

 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
#Value! error on code that should be correct? RHein Excel Discussion (Misc queries) 2 January 3rd 08 03:19 AM
is this vba code correct or is there a more simple way to do this ? Jean-Pierre D via OfficeKB.com Excel Programming 9 August 12th 05 05:13 PM
Code is not correct Pat Excel Programming 10 April 6th 05 02:03 AM
Help to correct code Pat Excel Programming 6 December 29th 04 05:02 PM
Can you help with the correct translation of this code? Just For Fun... Excel Programming 0 September 30th 04 06:16 AM


All times are GMT +1. The time now is 10:42 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"