+ 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
    50

    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
    50

    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,009

    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
    50

    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. 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

X vBulletin 4.1.8 Debug Information

  • Page Generation 0.08677 seconds
  • Memory Usage 8,958KB
  • Queries Executed 16 (?)
More Information
Template Usage (34):
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_global_above_footer
  • (1)ad_global_below_navbar
  • (1)ad_global_header1
  • (1)ad_global_header2
  • (1)ad_navbar_below
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (1)ad_thread_first_post_content
  • (1)ad_thread_last_post_content
  • (1)footer
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)headinclude_bottom
  • (4)memberaction_dropdown
  • (1)navbar
  • (4)navbar_link
  • (4)navbar_noticebit
  • (6)option
  • (3)postbit_attachment
  • (4)postbit_legacy
  • (4)postbit_onlinestatus
  • (4)postbit_wrapper
  • (4)showthread_bookmarksite
  • (7)showthread_similarthreadbit
  • (1)showthread_similarthreads
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper
  • (1)vbseo_linkbackmenu_entry 

Phrase Groups Available (6):
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files (39):
  • ./vbseo.php
  • ./env.php
  • ./vbseo/includes/functions_vbseo.php
  • ./vbseo/includes/functions_vbseo_pre.php
  • ./vbseo/includes/functions_vbseo_url.php
  • ./vbseo/includes/functions_vbseo_createurl.php
  • ./vbseo/includes/functions_vbseo_db.php
  • ./vbseo/includes/functions_vbseo_vb.php
  • ./vbseo/includes/functions_vbseo_seo.php
  • ./vbseo/includes/functions_vbseo_misc.php
  • ./vbseo/includes/functions_vbseo_crr.php
  • ./vbseo/includes/functions_vbseo_cache.php
  • ./vbseo/includes/functions_vbseo_hook.php
  • ./vbseo/includes/functions_vbseo_startup.php
  • ./includes/config.php
  • ./showthread.php
  • ./global.php
  • ./includes/class_bootstrap.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/functions.php
  • ./includes/class_friendly_url.php
  • ./includes/class_hook.php
  • ./includes/functions_cforum.php
  • ./includes/functions_facebook.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/class_bootstrap_framework.php
  • ./vb/vb.php
  • ./vb/phrase.php
  • ./packages/vbattach/attach.php
  • ./vb/types.php
  • ./vb/cache.php
  • ./vb/cache/db.php
  • ./vb/cache/observer/db.php
  • ./vb/cache/observer.php
  • ./includes/functions_notice.php 

Hooks Called (50):
  • init_startup
  • friendlyurl_resolve_class
  • database_pre_fetch_array
  • database_post_fetch_array
  • global_bootstrap_init_start
  • global_bootstrap_init_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • global_state_check
  • global_bootstrap_complete
  • global_start
  • style_fetch
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • friendlyurl_redirect_canonical
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • fetch_musername
  • cache_templates
  • template_register_var
  • parse_templates
  • notices_check_start
  • notices_noticebit
  • process_templates_complete
  • reputation_image
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_attachment
  • postbit_display_complete
  • memberaction_dropdown
  • tag_fetchbit
  • tag_fetchbit_complete
  • showthread_similarthread_query
  • showthread_similarthreadbit
  • forumrules
  • showthread_bookmarkbit
  • navbits
  • navbits_complete
  • showthread_complete


Search Engine Friendly URLs by vBSEO 3.6.0 RC 1