View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
david mcritchie david mcritchie is offline
external usenet poster
 
Posts: 691
Default copy & paste macro

Hi Arul,

Another thing to watch out for is assuming that the rows and columns will
"never" change in Excel. Excel now has 65536 rows which requires a long
integer. The sizes previous that only required an integer variable
for 16384 rows then 32768 rows. So don't tie yourself down to
integer variable use LONG and don't tie yourself down with fixed numbers.

Tom Ogilvy would code that part without a specific row number something like
Cells(Rows.Count, ActiveCell.Column).End(xlUp)
or for coloumn A
Cells(Rows.Count,"A").End(xlUp)

Of course this is really a method of trying to get around the fact that
Excel does not maintain a correct used range.

A couple of my favorite macros using Tom's coding can be seen in my
http://www.mvps.org/dmcritchie/excel/toolbars.htm
---
HTH,
David McRitchie, Microsoft MVP - Excel [site changed Nov. 2001]
My Excel Pages: http://www.mvps.org/dmcritchie/excel/excel.htm
Search Page: http://www.mvps.org/dmcritchie/excel/search.htm

"Arul" wrote in message ...
Thanks Ron. Not a big VBA wiz, however, managed to customize it.