+ Reply to Thread
Results 1 to 4 of 4

VBA - convert Imperial Size to Metric Size

  1. #1
    Registered User
    Join Date
    05-12-2015
    Location
    AU
    MS-Off Ver
    2010
    Posts
    58

    VBA - convert Imperial Size to Metric Size

    Hi Experts,

    Need VBA help to for a repetitive task in excel;

    I have the following spread sheet.
    1. cs-asmemetric1.xls that contains my catalog values
    2. NomDiaMap.csv that contains imperial-metrics sizes lookup table

    Steps for each worksheet:
    1. Copy all imperial size in column B (starts from B3 to last value)
    2. Paste copied imperial size to row 3 of column with name "mmSize". Column "mmSize" is not fix position. If possible add a condition: do not paste if row 3 of column "mmSize" is not blank/empty
    3. Replace/Convert imperial size in column "mmSize" to metric size as per lookup table NomDiaMap.csv
    4. Column "mmSize" shall be number stored as text only

    Process options: (user can run either active sheet only or the whole workbook)
    1. active worksheets
    2. all worksheets except worksheet "Catalog Data"

    Thank you in advance.

    NomSize_Imp2Metric.jpg
    Attached Files Attached Files

  2. #2
    Registered User
    Join Date
    05-12-2015
    Location
    AU
    MS-Off Ver
    2010
    Posts
    58

    Re: VBA - convert Imperial Size to Metric Size

    Need help to solve run-time error '91': and possible improvements

    The macro seems working if it is within the workbook but when I copied the exact code to Personal.xls, It run-error '91' when I run the macro.

    attached excel file with macro.

    error.jpg

    Thank you in advance.
    Attached Files Attached Files

  3. #3
    Forum Expert
    Join Date
    10-10-2016
    Location
    Sheffield
    MS-Off Ver
    365 and rarely 2016
    Posts
    3,210

    Re: VBA - convert Imperial Size to Metric Size

    surely a simple Vlookup would do what you wish, it would be easier with the csv file as a tab in the excel document

    Vlookup(inches value, the csvfileA:b,2,false)

  4. #4
    Registered User
    Join Date
    05-12-2015
    Location
    AU
    MS-Off Ver
    2010
    Posts
    58

    Re: VBA - convert Imperial Size to Metric Size

    @davsth

    The file cs-asmemetric1.xls is only a temporary export file from another application, once the changes finish, it will be imported to back.
    If this is a permanent file i will consider using vlookup.

    The macro inside the file was working fine. It only returns an error when I transfer the macro to personal.xlsb

+ 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. Formula to convert metric to imperial
    By Modify_inc in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 12-12-2018, 04:06 PM
  2. Curious about Metric versus Imperial
    By icevinson in forum Excel General
    Replies: 4
    Last Post: 12-02-2013, 05:04 PM
  3. [SOLVED] Metric to Imperial
    By lockye in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-25-2013, 12:43 PM
  4. Imperial / metric units
    By bejan in forum Excel General
    Replies: 2
    Last Post: 05-13-2009, 03:42 AM
  5. What is the Formula to Convert Imperial to Metric Measurements
    By compu_trainer in forum Excel Formulas & Functions
    Replies: 11
    Last Post: 09-06-2005, 03:05 AM
  6. [SOLVED] Metric to imperial measurements
    By Gill.star in forum Excel General
    Replies: 7
    Last Post: 03-06-2005, 10:06 PM
  7. Replies: 1
    Last Post: 02-23-2005, 09:23 PM

Tags for this Thread

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