Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Junior Member
 
Posts: 10
Smile Macro to copy cell value if part of string exist

Dear all,

I've columnA(code), columnB(type) and columnC(empty) in sheet1. I also have columnD(code) and columnE(name) in sheet2. If columnB value is REGION and the 3 character on the right of columnA is equal to value in columnD, then copy value in columnE into columnC. How to create macro to do this?..Below i illustrate the scenario. Thanks in advance for any help.

Sheet1
ColumnA ColumnB ColumnC
ABC2345 BANK
VGD3B23 REGION
HYT8T65 REGION

Sheet2
ColumnD ColumnE
345 VNA
T65 KLE

Expected result in Sheet1
ColumnA ColumnB ColumnC
ABC2345 BANK
VGD3B23 REGION VNA
HYT8T65 REGION KLE
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 173
Default Macro to copy top 3 value in column

Good Evening,

This is more of a manual process, but you could automate it with a macro. If you have a blank column next to your data, enter this formula to Rank the values using conditions (assumes data is in the range A1:B10 with a header row):

=1+SUMPRODUCT(($B$2:$B$10=B2)*($C$2:$C$10C2))

Now that you have a rank for each type of value in column B, you can either filter or use Advanced Filter to find the values you want to copy/paste.

Ben
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
Search/Match/Find ANY part of string to ANY part of Cell Value TWhizTom Excel Worksheet Functions 0 July 21st 08 08:16 PM
Copy Worksheet to a new Workbook creating if it doesn't exist and add more Worksheets if it does exist [email protected] Excel Programming 4 June 18th 06 06:08 PM
Using macro to copy a part of a cell content to next cell Charles Excel Discussion (Misc queries) 6 May 31st 06 05:57 AM
Use Macro to copy part of text in cell PhilipsBernard Excel Programming 2 October 17th 05 09:09 AM
Move Part of Cell String tom[_7_] Excel Programming 8 October 13th 05 06:37 PM


All times are GMT +1. The time now is 10:15 PM.

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

About Us

"It's about Microsoft Excel"