use this one
Sub Macro1() Dim i As Long For i = 2 To Sheets(2).Range("a1").End(xlDown).Row If IsEmpty(Sheets("Sheet2").Cells(i, 8).Value) Then Sheets("Sheet2").Cells(i, 8).Value = Sheets("Sheet2").Cells(i - 1, 8).Value Sheets("Sheet2").Cells(i, 9).Value = Sheets("Sheet2").Cells(i - 1, 9).Value Sheets("Sheet2").Cells(i, 10).Value = Sheets("Sheet2").Cells(i - 1, 10).Value Sheets("Sheet2").Cells(i, 11).Value = Sheets("Sheet2").Cells(i - 1, 11).Value End If Next i End Sub On Sun, Jan 16, 2011 at 8:39 PM, ashish koul <koul.ash...@gmail.com> wrote: > Sub Macro1() > Dim i As Long > > > For i = 2 To Sheets(2).Range("a1").End(xlDown).Row > > > If IsEmpty(Sheets("Sheet2").Cells(i, 8).Value) Then > > Sheets("Sheet2").Cells(i, 8).Value = Sheets("Sheet2").Cells(i - 1, > 8).Value > > Sheets("Sheet2").Cells(i, 9).Value = Sheets("Sheet2").Cells(i - 1, > 9).Value > Sheets("Sheet2").Cells(i, 10).Value = Sheets("Sheet2").Cells(i - 1, > 10).Value > Sheets("Sheet2").Cells(i, 11).Value = Sheets("Sheet2").Cells(i - 1, > 11).Value > End If > Sheets("Sheet2").Cells(i, 3).Value = Sheets("Sheet2").Cells(i, 10).Value > If InStr(Application.WorksheetFunction.Trim(Sheets("Sheet2").Cells(i, > 8).Value), "/BD") > 0 Then > Sheets("Sheet2").Cells(i, 4).Value = "Binding" > Else > Sheets("Sheet2").Cells(i, 4).Value = "Double Binding" > End If > > Next i > End Sub > > > > > > On Sun, Jan 16, 2011 at 8:04 PM, maulik desai <mauliksde...@gmail.com>wrote: > >> Thanks you very much Ashish Sir >> >> but actually i forget to add 2 columns in database table which is in >> output table.sorry for that because of that i am not getting the exact >> result. can u pls go through the updated file & make some changes in >> your maco & send it back >> >> Rest Output is perfect. >> >> Thanks in advance. >> >> On 1/16/11, ashish koul <koul.ash...@gmail.com> wrote: >> > check sheet 2 see if it helps >> > >> > On Sun, Jan 16, 2011 at 4:37 PM, maulik desai <mauliksde...@gmail.com >> >wrote: >> > >> >> Hi Excel Guru's, >> >> >> >> I have to extract data from Server & after cleaing Data i have to >> >> paste that data to my excel database prolem is In server we have to >> >> update the tag No on a weekly basis depending on the Product Name >> >> ,Some time Due to some problem server database not updated ontime so >> >> we have to update same in Exlcel databse but I want that this gap >> >> should be fill by macro. Attached fiel for more info. >> >> >> >> in Server database i am having 2 tag no but in Batch no1 there are >> >> total 5 entry are availble in server but only 2 entry are tagged i >> >> want that macro should fill the rest 3 entry & same task for batch 4 >> >> (eg. given in Attached file for better understaing ) >> >> >> >> need you support >> >> -- >> >> Thanks & Regards, >> >> Maulik Desai >> >> 9967363926 >> >> >> >> -- >> >> >> >> >> ---------------------------------------------------------------------------------- >> >> 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 >> >> >> > >> > >> > >> > -- >> > *Regards* >> > * * >> > *Ashish Koul* >> > *akoul*.*blogspot*.com <http://akoul.blogspot.com/> >> > *akoul*.wordpress.com <http://akoul.wordpress.com/> >> > My Linkedin Profile <http://in.linkedin.com/pub/ashish-koul/10/400/830> >> > >> > >> > P Before printing, think about the environment. >> > >> > -- >> > >> ---------------------------------------------------------------------------------- >> > 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 >> > >> >> >> -- >> Thanks & Regards, >> Maulik Desai >> 9967363926 >> >> -- >> >> ---------------------------------------------------------------------------------- >> 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 >> > > > > -- > *Regards* > * * > *Ashish Koul* > *akoul*.*blogspot*.com <http://akoul.blogspot.com/> > *akoul*.wordpress.com <http://akoul.wordpress.com/> > My Linkedin Profile <http://in.linkedin.com/pub/ashish-koul/10/400/830> > > > P Before printing, think about the environment. > > > -- *Regards* * * *Ashish Koul* *akoul*.*blogspot*.com <http://akoul.blogspot.com/> *akoul*.wordpress.com <http://akoul.wordpress.com/> My Linkedin Profile <http://in.linkedin.com/pub/ashish-koul/10/400/830> P Before printing, think about the environment. -- ---------------------------------------------------------------------------------- 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