Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default How to Fill the data

I have some historical data with some missing values for a certain
dates, such as holiday.

I need to replace all the missing value with previous date's data so
that I can do some analysis on it.

Here is the program. It works fine but it is extremely slow. it even
take more than 2 hours to run just 8000 cells!!!

Why is it so slow? Anyway to make it fast?

Thanks a lot,

ron

Private Sub filldata()

Sheets("Data").Select
NumofCell = Range("E9", Range("E9").End(xlDown)).Count

For i = 1 To NumofCell

If Not IsNumeric(Cells(i + 8, 5)) Then
Cells(i + 8, 5).value = Cells(i + 7, 5).value
End If
Next i

End Sub

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 125
Default How to Fill the data

First, try using this to get the last cell:
NumofCell = Cells(Rows.Count, "E").End(xlUp).Row

when I tried yours I got all 60,000+ of em.

and turn off screen updating

Application.ScreenUpdating = False

don't forget to turn it back on, 8 hours is rediculous at any rate.

-John

"ronwang1001" wrote:

I have some historical data with some missing values for a certain
dates, such as holiday.

I need to replace all the missing value with previous date's data so
that I can do some analysis on it.

Here is the program. It works fine but it is extremely slow. it even
take more than 2 hours to run just 8000 cells!!!

Why is it so slow? Anyway to make it fast?

Thanks a lot,

ron

Private Sub filldata()

Sheets("Data").Select
NumofCell = Range("E9", Range("E9").End(xlDown)).Count

For i = 1 To NumofCell

If Not IsNumeric(Cells(i + 8, 5)) Then
Cells(i + 8, 5).value = Cells(i + 7, 5).value
End If
Next i

End Sub


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Data Fill SAL Excel Discussion (Misc queries) 4 September 5th 07 05:59 PM
Filter data and fill only filtered data Thad Meyers[_2_] Excel Discussion (Misc queries) 1 August 30th 07 06:26 PM
pls help for fill data shital shah Excel Programming 1 August 16th 06 07:34 PM
Fill in data if PaolaAndrea Excel Discussion (Misc queries) 5 February 27th 06 07:51 PM
I have a list of data, fill in the gaps. FILL function won't work Triv Excel Discussion (Misc queries) 1 September 17th 05 02:33 PM


All times are GMT +1. The time now is 12:28 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"