Forum

Find value where th...
 
Notifications
Clear all

Find value where the middle 10 digits match other values in a column, then change those values.

3 Posts
2 Users
0 Reactions
75 Views
(@scoti261)
Posts: 5
Active Member
Topic starter
 

Hello,

Sorry I am new here but I am stuck. I am working on a project where the user copies a file to a few new sheets(up to 5), then for each new sheet created loops through column A and finds the cells where the middle 10 digits match. These matching cell values will then be changed to match what the user inputed into a textbox. For example, they will insert file # 2699466 into the import box and put M06810337001 in the box to the right. Then for example say they need 3 copies made from that original file, they would insert 3 file #'s in the boxes below(Tcu, Mo, Fe, etc) and a different "M" number in the box to the right of each of those 3 boxes. What should happen when they click transform is that the macro will look down column A on the 2nd copied sheet(named as the file # in the Tcu box) find the cells that have matching 10 middle digits(for example, M06810337001) change the one that ends in a 1 to the "M" number in the box to the right of the Tcu box file #, then continue down the column changing only the 1st 11 characters(i.e. leaving the 2 at the end). It should continue down the column to each matching found "M" #, change the 1st 11 characters leaving the last. 

The reason we need this is because we have an original file which contains "base" values indicated by the first 11 digits being the same and the last digit being sequentially numbered as it goes down the column. However, to import this data into another program we need to change the base values before saving it as a different file number. We usually do this 4 or 5 times per original file which can contain up to 20 base values for each file. This is very time consuming to do manually so I wanted to come up with a macro which could complete this for us quickly. 

I would really appreciate anyone's help on this. I am fairly new to vba so I was only able to get so far. Thank you in advance for taking the time to help. I have attached the "Oes transformer" as well an example base file. 

 
 
Posted : 20/11/2022 9:32 pm
(@keebellah)
Posts: 373
Reputable Member
 

Good morning, I'll take a look later today, see if I understand it and if I can help.

 
Posted : 22/11/2022 3:34 am
(@keebellah)
Posts: 373
Reputable Member
 

Hi, sorry for the delay, ran into some issues with my system.

Haven't forgotten you 

 
Posted : 26/11/2022 3:13 am
Share: