Mr. Chris Spicer
Thank you very much for your immediate reply, i tried with the quick fix
solution u suggested is not leading to correct merging. Can you plz clarify
if the 'sheet.usedrange' should replace that line or insert in some other
place. To be frank am not used to this visual basic.

On Thu, Jun 11, 2009 at 4:04 PM, Chris Spicer
<chris.spi...@technicana.com>wrote:

>
> Hi Satish,
>
> Thanks for the sample.  The bug occurs at this line:
>
> Range("A1:Z" & Cells(Rows.Count, "A").End(xlUp).Row).Copy
>
> Column A only uses 92 rows, so this part of the command:
>
> Cells(Rows.Count, "A").End(xlUp).Row
>
> returns 92, effectively resulting in the following:
>
> Range("A1:Z92").Copy
>
> As a quick fix, replace your line of code with the following:
>
> Range("A1:Z" & Cells(Rows.Count, "B").End(xlUp).Row).Copy
>
>
> A more elegant option might be to use 'Sheet.UsedRange' or similar.
>
> Hope this helps!
>
> Chris Spicer
> www.Technicana.com
>
> >
>


-- 
Satish P N
Asst. Manager
South Indian Bank

--~--~---------~--~----~------------~-------~--~----~
-------------------------------------------------------------------------------------
Some important links for excel users:
1. Excel and VBA Tutorials(Video and Text), Free add-ins downloads at 
http://www.excelitems.com
2. Excel tutorials at http://www.excel-macros.blogspot.com
3. Learn VBA Macros at http://www.vbamacros.blogspot.com
4. Excel Tips and Tricks at http://exceldailytip.blogspot.com
 

To post to this group, send email to excel-macros@googlegroups.com
If you find any spam message in the group, please send an email to:
Ayush Jain  @ jainayus...@gmail.com or
Ashish Jain @ 26may.1...@gmail.com
-------------------------------------------------------------------------------------
-~----------~----~----~----~------~----~------~--~---

Reply via email to