JACOB - About your answer to my question...


Posted by Dave on January 17, 2002 4:23 AM

Errr... you remember the post you made in response to my combining sheets post? (15242.html)

well, i'm getting "invalid or unqualified reference" errors at the first ".find" line.
i tried adding "application" to the front of the .find (which may or may not be right...) which seems to help a bit, but then i get "block if without end if" errors at the "next i" line.
Any ideas? if it helps, i'm using excel 97.

Cheers,
Dave

Posted by Menenius on January 17, 2002 5:17 AM

Try this instaed .....


Dim ws As Worksheet
For Each ws In Worksheets
If ws.Name <> "New Sheet" Then ws.UsedRange.Copy Worksheets("New Sheet").Range("A65536").End(xlUp).Offset(2, 0)
Next


Posted by Dave on January 17, 2002 6:12 AM

Re: Try this instaed .....

Tried that (put "sub test" and "end sub" either side) but, get subscript out of range error in the line begining "ws.usedrange...."
what did i do wrong?

Dave

Posted by Menenius on January 17, 2002 6:17 AM

Re: Try this instaed .....


Don't know. I just tried it and it works.
Do you have a sheet named New Sheet ?

Posted by Dave on January 17, 2002 6:18 AM

Apologies! my mistake.......

Ahem..... sorry! once i'd added the bit about adding a sheet to your script (which you probably asumed i would anyway) it worked beautifully.
Thanks,

Dave

Posted by Menenius on January 17, 2002 6:20 AM

Re: Try this instaed .....


Mote :
There is no line that starts with "ws.Usedrange".
The code "If ws.Name <> "New Sheet" Then ws.UsedRange.Copy Worksheets("New Sheet").Range("A65536").End(xlUp).Offset(2, 0)" is all on one line.


Posted by cheltenham racecourse on January 17, 2002 6:22 AM

Works now, Thanks

Its OK now! i'd forgotten to do the add sheet bit so, it had no target for the rest of the code.
All sorted now!
Thanks again,
Dave




Posted by Dave on January 17, 2002 6:23 AM

"cheltenham racecourse" should read Dave... Damn autocomplete lists! (nt)