LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Junior Member
 
Posts: 10
Exclamation How to replace cell value based on other cell's value using macro

Dear all,

I have 2 excel files. The first file is the main file that have transactions. The other file contain static data which is a list of full code, description & short code. How do i create a macro to replace the full code(ColumnC) in main file with description(ColumnB) found in the static data file? But change the full code(ColumnC) in the main file only if the value in ColumnB is SOLID and the first 2 character in full code(ColumnC) is equal to short code(ColumnC) in the static data file.The following is the scenario for better understanding. Thanks in advance for any help given.

Main file:
ColumnA ColumnB ColumnC
XY12083 SOLID HHIY
LK02491 TEMP HYTO
BGY1232 SOLID BSVV
UYTB981 SAMPEL JIEI

Static data file:
ColumnA ColumnB ColumnC
HHIY Household HH
HHXS Household HH
BSVV Bookstore BS
BSKY Bookstore BS
SPTB Sports SP
SPMI Sport SP

Expected output in the main file:
ColumnA ColumnB ColumnC
XY12083 SOLID Household
LK02491 TEMP HYTO
BGY1232 SOLID Bookstore
UYTB981 SAMPEL JIEI
 
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
Find and replace a character in a cell with another cell's content JABAgdl Excel Programming 1 September 23rd 09 02:34 AM
increment cell value based on another cell's value Rosa Hildur Excel Programming 1 July 1st 08 09:31 PM
Select a cell based on an other cell's value wally_91 Excel Worksheet Functions 4 March 13th 08 12:24 AM
insert rows based on a cell's value (macro) Shoney Excel Programming 2 February 28th 08 02:14 AM
Varying a macro based on a cell's value Neal Zimm Excel Programming 4 December 27th 04 06:37 AM


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