Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default Data correction

Hi,

Please find below a data extract from one of my excel sheet:
Holder Id Ref
I0009904220 00052432/C ON:
I0079752762 00049098/C ON:
00049099/C ON:
I0010853834 00049292/C ON:

Holder Id Ref
I0079752762 00051203/C ON:
00051204/C ON:
I0010853834 00051406/C ON:
I0014171215 00053957/C ON:
I0024522547 00054193/C ON:

The above is just an extract. My sheet has around 18,000 rows. My task
is to go through all those rows and basically identify those with no
value in column 1 and a value of ON: in column 3. If I find any such
row then I have to copy column 1's value with that of the row above it.
So the above would change to:
Holder Id Ref
I0009904220 00052432/C ON:
I0079752762 00049098/C ON:
I0079752762 00049099/C ON:
I0010853834 00049292/C ON:

Holder Id Ref
I0079752762 00051203/C ON:
I0079752762 00051204/C ON:
I0010853834 00051406/C ON:
I0014171215 00053957/C ON:
I0024522547 00054193/C ON:

As it's a huge file I though may be someone can provide me code for it
or suggest me how to accomplish this task quickly.

Thanks in advance.

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,163
Default Data correction

Public Sub FixData()
Dim NumRows as Long, ThisRow as Long
Dim StoredValue as String

With Worksheets("SheetName")
NumRows = .UsedRange.Rows.Count
StoredValue = ""
For ThisRow = 1 to NumRows
If .Cells(ThisRow,3)=":ON" Then
If .Cells(ThisRow,1)="" Then
.Cells(ThisRow,1) = StoredValue
Else
StoredValue = .Cells(ThisRow,1)
End If
End If
Next ThisRow
End With

End Sub

Hope I got it OK!

" wrote:

Hi,

Please find below a data extract from one of my excel sheet:
Holder Id Ref
I0009904220 00052432/C ON:
I0079752762 00049098/C ON:
00049099/C ON:
I0010853834 00049292/C ON:

Holder Id Ref
I0079752762 00051203/C ON:
00051204/C ON:
I0010853834 00051406/C ON:
I0014171215 00053957/C ON:
I0024522547 00054193/C ON:

The above is just an extract. My sheet has around 18,000 rows. My task
is to go through all those rows and basically identify those with no
value in column 1 and a value of ON: in column 3. If I find any such
row then I have to copy column 1's value with that of the row above it.
So the above would change to:
Holder Id Ref
I0009904220 00052432/C ON:
I0079752762 00049098/C ON:
I0079752762 00049099/C ON:
I0010853834 00049292/C ON:

Holder Id Ref
I0079752762 00051203/C ON:
I0079752762 00051204/C ON:
I0010853834 00051406/C ON:
I0014171215 00053957/C ON:
I0024522547 00054193/C ON:

As it's a huge file I though may be someone can provide me code for it
or suggest me how to accomplish this task quickly.

Thanks in advance.


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default Data correction

Thanks

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 collection Sum/Total (correction 2) Michael_R Excel Discussion (Misc queries) 0 March 30th 10 03:08 PM
Formula Correction Pat Excel Discussion (Misc queries) 5 August 24th 08 03:17 AM
Value correction P. Zicari Excel Discussion (Misc queries) 2 April 15th 08 07:28 PM
syntax correction Richard Excel Worksheet Functions 4 February 14th 07 08:30 PM
correction nowfal Excel Discussion (Misc queries) 4 March 24th 06 06:40 PM


All times are GMT +1. The time now is 11:31 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"