maybe? Untested Sheets("PivotTable").Cells(2, 10).Value = format(sheets(“summary”).Cells(5, "C").End(xlDown).Offset(1, -2),”asdesired”)
Don Guillett SalesAid Software dguille...@gmail.com From: NOORAIN ANSARI Sent: Tuesday, December 20, 2011 12:16 AM To: excel-macros@googlegroups.com Subject: Re: $$Excel-Macros$$ Instead of using Isempty(), what other ways can be used for filling up the data with Small correction Dear Darwin, You can use Cells(i, 3)="" or Cells(i, 3)=vbnullstring instead of IsEmpty(Cells(i, 3)). - Thanks & regards, Noorain Ansari http://excelmacroworld.blogspot.com/ http://noorain-ansari.blogspot.com/ On Tue, Dec 20, 2011 at 11:21 AM, Darwin Chan <darwin.chankaw...@gmail.com> wrote: Dear all, I have created a report to copy the data from a sheet to another. However, i use isempty to check where to paste the data, but I found there is performance issue. Is there any other way out other than using Isempty()?? File: http://www.sendspace.com/file/64pseo Below can find the code and also the file. Sub reportdata() 'Paste the data according to the date of report Dim dt As Integer Dim i As Integer Dim datarow As Integer Dim rpdate As String 'Get the date of report need to finish (without data) Sheets("Summary").Activate datarow = Range("A" & Rows.Count).End(xlUp).Row For i = 166 To datarow If IsEmpty(Cells(i, 3)) Then rpdate = Format(Left(Cells(i, 3).Offset(0, -2).Value, 10), "yyyy-mm-dd") Exit For End If Next Sheets("PivotTable").Cells(2, 10).Value = rpdate dt = Sheets("PivotTable").Cells(2, 12).Value '20', 40, RF marshalling btw CY/CFS and MR/CMR AND disc/load btw BH/V/L and MR/CMR Sheets("PivotTable").Range("L4").Resize(12, 74).Copy Worksheets("Summary").Cells(dt, 2).PasteSpecial (xlPasteValues) End Sub -- Darwin Chan darwin.chankaw...@gmail.com kw42c...@yahoo.com.hk -- FORUM RULES (934+ members already BANNED for violation) 1) Use concise, accurate thread titles. Poor thread titles, like Please Help, Urgent, Need Help, Formula Problem, Code Problem, and Need Advice will not get quick attention or may not be answered. 2) Don't post a question in the thread of another member. 3) Don't post questions regarding breaking or bypassing any security measure. 4) Acknowledge the responses you receive, good or bad. 5) Cross-promotion of, or links to, forums competitive to this forum in signatures are prohibited. NOTE : Don't ever post personal or confidential data in a workbook. Forum owners and members are not responsible for any loss. ------------------------------------------------------------------------------------------------------ To post to this group, send email to excel-macros@googlegroups.com - -- Thanks & regards, Noorain Ansari http://excelmacroworld.blogspot.com/ http://noorain-ansari.blogspot.com/ -- FORUM RULES (934+ members already BANNED for violation) 1) Use concise, accurate thread titles. Poor thread titles, like Please Help, Urgent, Need Help, Formula Problem, Code Problem, and Need Advice will not get quick attention or may not be answered. 2) Don't post a question in the thread of another member. 3) Don't post questions regarding breaking or bypassing any security measure. 4) Acknowledge the responses you receive, good or bad. 5) Cross-promotion of, or links to, forums competitive to this forum in signatures are prohibited. NOTE : Don't ever post personal or confidential data in a workbook. Forum owners and members are not responsible for any loss. ------------------------------------------------------------------------------------------------------ To post to this group, send email to excel-macros@googlegroups.com -- FORUM RULES (934+ members already BANNED for violation) 1) Use concise, accurate thread titles. Poor thread titles, like Please Help, Urgent, Need Help, Formula Problem, Code Problem, and Need Advice will not get quick attention or may not be answered. 2) Don't post a question in the thread of another member. 3) Don't post questions regarding breaking or bypassing any security measure. 4) Acknowledge the responses you receive, good or bad. 5) Cross-promotion of, or links to, forums competitive to this forum in signatures are prohibited. NOTE : Don't ever post personal or confidential data in a workbook. Forum owners and members are not responsible for any loss. ------------------------------------------------------------------------------------------------------ To post to this group, send email to excel-macros@googlegroups.com