+ Reply to Thread
Results 1 to 9 of 9

new to vba forum looking to search and replace

  1. #1
    Registered User
    Join Date
    03-24-2013
    Location
    australia
    MS-Off Ver
    Excel 2007
    Posts
    7

    new to vba forum looking to search and replace

    Hi Professionals.

    I am new to vba programming as I am originally from an Oracle background.

    anyway I have a number of very large spreadsheets which have a column with version numbers from various vendors, what I am looking to do is enable my work colleagues to just click a button and ammend the versions by looking for the first . and replace something like this

    version numbers raw
    11.3.2.1
    10.5.2.1
    10.4.1.1
    401.3.2
    null
    unknown

    amended
    11.x
    10.x
    10.x
    401.x
    version unknown
    version unknown

    can this be done via a button click

    thanks all

  2. #2
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: new to vba forum looking to search and replace

    Hi,

    Do you really need a macro. You could keep a column which reads the version and converts it. e.g.
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    Or if you do need a macro just have the macro create the formula in a spare helper column, copy the column and paste it back as values to the original column then delete the helper column.
    Richard Buttrey

    RIP - d. 06/10/2022

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

  3. #3
    Registered User
    Join Date
    03-24-2013
    Location
    australia
    MS-Off Ver
    Excel 2007
    Posts
    7

    Re: new to vba forum looking to search and replace

    Hi Richard

    Thanks for that like I said i am totally new to this, I have over 42000 column values that need converting could you explain to me what you mean exactly by keep a column I have pasted the following formula at the bottom of row b after the values but nothing is happening

    =IFERROR(LEFT(B1,FIND(".",B1)-1)&".x","version unknown")

  4. #4
    Registered User
    Join Date
    03-24-2013
    Location
    australia
    MS-Off Ver
    Excel 2007
    Posts
    7

    Re: new to vba forum looking to search and replace

    Hi again Richard

    I have figured out how to put the formula in but it does not work properly. If I have a column value with just version 6 or 7 it shows up as "version unknown"

    please advise

    thanks
    Alan

  5. #5
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: new to vba forum looking to search and replace

    Hi,

    Your original post implied all versions had a . separating elements of the version number. When posting questions it's important to mention all relevant factors and this should include all permutations of data. My answer was based on the fact that all versions proper had a . in them.

    Maybe
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    but that assumes a single version digit is a number and not text that just happens to look like a number.

  6. #6
    Registered User
    Join Date
    03-24-2013
    Location
    australia
    MS-Off Ver
    Excel 2007
    Posts
    7

    Re: new to vba forum looking to search and replace

    thanks richard sorry for not explaining properly

  7. #7
    Registered User
    Join Date
    03-24-2013
    Location
    australia
    MS-Off Ver
    Excel 2007
    Posts
    7

    Re: new to vba forum looking to search and replace

    yes it could be a text value that looks like a number

  8. #8
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: new to vba forum looking to search and replace

    Hi,

    We need to know whether it could be either. i.e. either text OR a number in order to cover all bases.

  9. #9
    Registered User
    Join Date
    03-24-2013
    Location
    australia
    MS-Off Ver
    Excel 2007
    Posts
    7

    Re: new to vba forum looking to search and replace

    Hi again


    it could be a number or it could be text that looks like a number


    thanks

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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