Just paste this formula into all your blank cells of Column A that are next to data in B column.
=INDEX(B4:$B$1000,MATCH("*bank*",B4:$B$1000,0))
Increase the 1000 if your rows extend further.
First select your range by selecting A3 then Control + *
Use F5, Special Blanks to select your cells.
Paste the formula to the formula bar, then press Control + Enter.
No VBA code is necessary, although if you must have it, just record the above to see it.
Regards Robert
"nijan_shah " wrote in message ...
Hi
I wonder if you can help me. I am attaching an Excel 2000 file that
shows and extract from our Financial System. Basically there are 3
columns- Cost Centre, Accounting Codes and £.
There is a cost centre name (in red) in the subtotal row in the
Accounting Codes column. What I would like to do is to write a macro
that will search the column "Accounting Codes" for the cost centre name
and then paste that name in the Cost Center column for each of the rows
that belong to that cost centre up to the subtotal line.
Thank you in advance
Regards
Nijan
Attachment filename: test.xls
Download attachment: http://www.excelforum.com/attachment.php?postid=450283
---
Message posted from http://www.ExcelForum.com/
---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (
http://www.grisoft.com).
Version: 6.0.593 / Virus Database: 376 - Release Date: 21/02/2004