+ Reply to Thread
Results 1 to 3 of 3

add prefix to number based on validation from other data if found prefix 0, do nothing

  1. #1
    Forum Contributor
    Join Date
    12-17-2012
    Location
    indonesia
    MS-Off Ver
    Excel 2019
    Posts
    170

    add prefix to number based on validation from other data if found prefix 0, do nothing

    99.JPG
    Hi I got macros from bakerman as below, the case that I found is if column AT already have prefix 0 it will double the 0 in prefix
    for example before running macro = 02174634162 , after running =002174634162.
    is someone know how to modify below macros , so if found prefix 0 on column AT just leave that cell alone.thx

    Sub addprefix0ncheckToCodeArea()
    On Error Resume Next
    For Each cl In Range("AT1", Range("AT" & Rows.Count).End(xlUp))
    If Left(cl.Value, 2) = Mid(Columns(64).Find(cl.Offset(, 9), , xlValues, xlWhole).Offset(, 1), 2, 2) Then
    cl.Value = 0 & cl.Value
    Else
    cl.Value = Columns(64).Find(cl.Offset(, 9), , xlValues, xlWhole).Offset(, 1) & cl.Value
    End If
    Next
    End Sub



    is there a way to exclude the calculation if found prefix 0, or do nothing, thx
    Attached Files Attached Files

  2. #2
    Valued Forum Contributor than_gold's Avatar
    Join Date
    10-17-2017
    Location
    Coimbatore India
    MS-Off Ver
    Office 365
    Posts
    646

    Re: add prefix to number based on validation from other data if found prefix 0, do nothing

    Here you go:

    Please Login or Register  to view this content.
    Regards,
    Thangavel D

    Appreciate the help? CLICK *

  3. #3
    Forum Contributor
    Join Date
    12-17-2012
    Location
    indonesia
    MS-Off Ver
    Excel 2019
    Posts
    170

    Re: add prefix to number based on validation from other data if found prefix 0, do nothing

    thx than gold

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] add prefix to number based on validation from other data
    By oeyandyprawira in forum Excel Programming / VBA / Macros
    Replies: 13
    Last Post: 12-11-2018, 11:49 PM
  2. [SOLVED] add prefix to number based on other data
    By oeyandyprawira in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 12-05-2018, 04:19 PM
  3. [SOLVED] Extract Multi-line Data Based on prefix
    By chilli16 in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 05-29-2018, 05:15 AM
  4. Need VBA Code to remove number prefix if name found on another list
    By Bobbbo in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 04-12-2018, 01:56 PM
  5. Replies: 4
    Last Post: 08-07-2017, 06:45 PM
  6. extracting page number ranges based on prefix of sorted data
    By wdjohnson in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 09-06-2016, 05:34 PM
  7. Data validation to keep a prefix
    By Chemistification in forum Excel General
    Replies: 5
    Last Post: 07-08-2010, 01:10 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1