• Skip to main content
  • Skip to header right navigation
  • Skip to site footer

My Online Training Hub

Learn Dashboards, Excel, Power BI, Power Query, Power Pivot

  • Courses
  • Pricing
    • Free Courses
    • Power BI Course
    • Excel Power Query Course
    • Power Pivot and DAX Course
    • Excel Dashboard Course
    • Excel PivotTable Course – Quick Start
    • Advanced Excel Formulas Course
    • Excel Expert Advanced Excel Training
    • Excel Tables Course
    • Excel, Word, Outlook
    • Financial Modelling Course
    • Excel PivotTable Course
    • Excel for Customer Service Professionals
    • Excel for Operations Management Course
    • Excel for Decision Making Under Uncertainty Course
    • Excel for Finance Course
    • Excel Analysis ToolPak Course
    • Multi-User Pricing
  • Resources
    • Free Downloads
    • Excel Functions Explained
    • Excel Formulas
    • Excel Add-ins
    • IF Function
      • Excel IF Statement Explained
      • Excel IF AND OR Functions
      • IF Formula Builder
    • Time & Dates in Excel
      • Excel Date & Time
      • Calculating Time in Excel
      • Excel Time Calculation Tricks
      • Excel Date and Time Formatting
    • Excel Keyboard Shortcuts
    • Excel Custom Number Format Guide
    • Pivot Tables Guide
    • VLOOKUP Guide
    • ALT Codes
    • Excel VBA & Macros
    • Excel User Forms
    • VBA String Functions
  • Members
    • Login
    • Password Reset
  • Blog
  • Excel Webinars
  • Excel Forum
    • Register as Forum Member

Find value where the middle 10 digits match other values in a column, then change those values. |VBA & Macros|Excel Forum|My Online Training Hub

You are here: Home / Find value where the middle 10 digits match other values in a column, then change those values. |VBA & Macros|Excel Forum|My Online Training Hub
Avatar
sp_LogInOut Log In sp_Registration Register
sp_Search Search
Advanced Search
Search
Forum Scope




Match



Forum Options



Minimum search word length is 3 characters - maximum search word length is 84 characters
sp_Search Search
sp_RankInfo
Lost password?
sp_CrumbsHome HomeExcel ForumVBA & MacrosFind value where the middle 10 digi…
sp_PrintTopic sp_TopicIcon
Find value where the middle 10 digits match other values in a column, then change those values.
Avatar
Scoti Montierth

Active Member
Members
Level 0
Forum Posts: 5
Member Since:
November 24, 2020
sp_UserOfflineSmall Offline
1
November 20, 2022 - 11:32 am
sp_Permalink sp_Print

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. 

 
Avatar
Hans Hallebeek
the Netherlands
Member
Members
Level 0
Forum Posts: 71
Member Since:
October 17, 2018
sp_UserOfflineSmall Offline
2
November 21, 2022 - 5:34 pm
sp_Permalink sp_Print

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

Avatar
Hans Hallebeek
the Netherlands
Member
Members
Level 0
Forum Posts: 71
Member Since:
October 17, 2018
sp_UserOfflineSmall Offline
3
November 25, 2022 - 5:13 pm
sp_Permalink sp_Print

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

Haven't forgotten you 

sp_Feed
Go to top
Forum Timezone: Australia/Brisbane
Most Users Ever Online: 245
Currently Online: baber Tufail
Guest(s) 9
Currently Browsing this Page:
1 Guest(s)
Top Posters:
SunnyKow: 1432
Anders Sehlstedt: 870
Purfleet: 412
Frans Visser: 346
David_Ng: 306
lea cohen: 219
A.Maurizio: 202
Jessica Stewart: 202
Aye Mu: 201
jaryszek: 183
Newest Members:
drsven
Annie Witbrod
wahab tunde
Cong Le Duc
Faisal Bashir
Ivica Cvetkovski
Blaine Cox
Shankar Srinivasan
riyepa fdgf
Hannah Cave
Forum Stats:
Groups: 3
Forums: 24
Topics: 6205
Posts: 27211

 

Member Stats:
Guest Posters: 49
Members: 31880
Moderators: 3
Admins: 4
Administrators: Mynda Treacy, Philip Treacy, Catalin Bombea, FT
Moderators: MOTH Support, Velouria, Riny van Eekelen
© Simple:Press —sp_Information

Sidebar

Blog Categories

  • Excel
  • Excel Charts
  • Excel Dashboard
  • Excel Formulas
  • Excel PivotTables
  • Excel Shortcuts
  • Excel VBA
  • General Tips
  • Online Training
  • Outlook
  • Power Apps
  • Power Automate
  • Power BI
  • Power Pivot
  • Power Query
microsoft mvp logo
trustpilot excellent rating
Secured by Sucuri Badge
MyOnlineTrainingHub on YouTube Mynda Treacy on Linked In Mynda Treacy on Instagram Mynda Treacy on Twitter Mynda Treacy on Pinterest MyOnlineTrainingHub on Facebook
 

Company

  • About My Online Training Hub
  • Disclosure Statement
  • Frequently Asked Questions
  • Guarantee
  • Privacy Policy
  • Terms & Conditions
  • Testimonials
  • Become an Affiliate

Support

  • Contact
  • Forum
  • Helpdesk - For Technical Issues

Copyright © 2023 · My Online Training Hub · All Rights Reserved. Microsoft and the Microsoft Office logo are trademarks or registered trademarks of Microsoft Corporation in the United States and/or other countries. Product names, logos, brands, and other trademarks featured or referred to within this website are the property of their respective trademark holders.