Your code looks like to be run in excel 2003 only (1) In both excel 2003 / excel 2007 Range("A65000") ' last row in A column can be coded as Cells(*Rows.Count*,1) or Range("A" & *Rows.Count*)
(2) *Value* property of a Range Object is a *DEFAULT Property* so you can ignore it For example Range("A1").*Value* = Range("C1").*Value* can be coded as: Range("A1") = Range("C1") * * On Sat, May 7, 2011 at 1:14 PM, rajan verma <rajanverma1...@gmail.com>wrote: > Private Sub CommandButton1_Click() > *Range("A65000")*.End(xlUp).Cells(2, 1) = Range("C1").Value: * > Range("A65000")*.End(xlUp).Cells(1, 2) = Range("D1").Value: > End Sub > > > On Sat, May 7, 2011 at 1:56 AM, Indrajit $nai <talk2indra...@gmail.com>wrote: > >> Hi All, >> I have a little query in vba coding, please see the attached file. In the >> excel file there is a "Save" command button, whenever I press the button it >> will copy the data from cell no. c1:d1 and paste in the cell a1:b1, now my >> query is, if the data is already in the cell no. a1:b1 it will be saved in >> the next cell no. means a2:b2 then a3:b3 just going on like this, can anyone >> help me in that coding how do I create that loop? >> Thanks in advance. >> Indrajit >> > -- ---------------------------------------------------------------------------------- Some important links for excel users: 1. Follow us on TWITTER for tips tricks and links : http://twitter.com/exceldailytip 2. Join our LinkedIN group @ http://www.linkedin.com/groups?gid=1871310 3. Excel tutorials at http://www.excel-macros.blogspot.com 4. Learn VBA Macros at http://www.quickvba.blogspot.com 5. Excel Tips and Tricks at http://exceldailytip.blogspot.com To post to this group, send email to excel-macros@googlegroups.com <><><><><><><><><><><><><><><><><><><><><><> Like our page on facebook , Just follow below link http://www.facebook.com/discussexcel