Tuesday, June 15

VBA FOR MEP CALCULATIONS


  • Application ေတြထဲ မွာ Programming အမ်ိဳးမ်ိဳး သံုးလို႔ ရပါတယ္။ ဒီအထဲ မွာ သံုးတတ္ရင္ အခ်ိန္ကုန္ သက္သာေစတဲ့ VBA (Visual Basics for Application) ကိုသံုးၿပီး Engineering Formula Functions ေတြ ေရးတာ ကို မိတ္ဆက္ေပး ဘို႔ ရည္ရြယ္ထားပါတယ္။
  • အဓိက သံုးမဲ့ ေနရာ က ေတာ့ spread sheet (Microsoft Excel) အတြက္ ပါ။ တကယ္ေတာ့ VBA က MS Offices ေတြ၊ Web Script ေတြ အတြက္ သာ မက AutoCad ® မွာလည္း အသံုးျပဳလို႔ ေကာင္းတဲ့ programming တစ္ခုပါ။ AutoCad ® ကိုသံုးတဲ့ သူေတြ အတြက္ AutoLisp, vBA, Diesel, Script စတဲ့ programming အခ်ိဳ႕ကို နားလည္ရင္ ထပ္တလဲလဲ လုပ္ရတဲ့ process ေတြ ကို အခ်ိန္ကုန္ သက္သာစြာ နဲ႔ လုပ္ေဆာင္ ႏိုင္ပါတယ္။ ရႈတ္ရႈတ္ေထြးေထြး တြက္ခ်က္ဘို႔ လိုအပ္တာေတြ၊ Trial and error Loop နဲ႔တြက္ရတာေတြ အတြက္လည္း တစ္ႀကိမ္ စနစ္တက် ေခါင္းရႈတ္ခံ လိုက္ရင္ ေနာက္တစ္ခါ သံုးဘို႔ အဆင္သင့္ ျဖစ္ေစပါမယ္။

  1. Basic of Programming
    • Programming Languages အလိုက္ Detail အမ်ိဳးမ်ိဳး ျဖစ္ႏိုင္ေပမဲ့ basic instructions အခ်ိဳ႕ ကေတာ့ Languages တိုင္းလိုလို မွာပါဝင္ေနတာ ေတြ႕ရပါမယ္။
      • input: Get data from the keyboard, a file, or some other device.
      • output: Display data on the screen or send data to a file or other device.
      • Math / Operation : Perform basic mathematical operations like addition and multiplication.
      • conditional execution: Check for certain conditions and execute the appropriate sequence of statements.
      • repetition: Perform some action repeatedly, usually with some variation.
    • ဒါေတြရဲ့ အေျခခံ ေတြ ကို Algorithm (or) Pseudocode and Program Flow Chart ေတြနဲ႔ ျပလို႔ ရပါတယ္။ Modular programming လို႔ေခၚတဲ့ Program အေသးေလး ေတြ အပိုင္းလိုက္ အကန္႔လိုက္ အစိတ္စိတ္ သီးျခားခြဲ ေရးၿပီး မွ ေပါင္းစပ္ သံုးတဲ့ အခါ ေရးရတာေရာ၊ debug လုပ္ရတာေရာ လြယ္ကူလာပါတယ္။
    • Program ေရးတဲ့ အခါ စနစ္ တက် Planning လုပ္ထားခဲ့ဘို႔ လိုအပ္ပါတယ္။ မဟုတ္ရင္ အမွားရွာရ ျပင္ရ စတဲ့ Debugging လုပ္ရတာ က ေရးရတာထက္ အဆေပါင္း မ်ားစြာ ပိုခက္ေစရံု သာမက Crush ျဖစ္တဲ့ ျပႆနာ ေတြကိုပါ ထပ္ရွင္း ေနရပါလိမ့္ အံုးမယ္။
    • Programming Flowchart နဲ႔ ပတ္သက္ၿပီး http://www.nos.org/htm/basic2.htm မွာ သြား ေရာက္ ေလ့လာ ႏိုင္ပါတယ္။ အဓိက သိသင့္တာ ကေတာ့
      • Start / End : အစ နဲ႔ အဆံုး (Programming တိုင္းမွာ အစ (Start) နဲ႔ အဆံုး (End) ပါဝင္ရပါမယ္။) သူ႕ရဲ့ ပံုက ေထာင့္ကို လံုးထားတဲ့ စတုဂံ ပံုပါ။
      • Process : Computational steps or processing function of a program၊ ပံုက ရိုးရိုး စတုဂံပံုပါ။
      • Decision Making and Branching၊ ႐ြမ္းဗတ္ ပံု။


  2. VBA for Excel
    Excel အတြက္ VBA Application ကိုေလ့လာတဲ့ အခါ သိသင့္တာေတြ ကေတာ့၊
    • VB for Application
    • VB for Excel Application
    • Files (personal.xls or add-in ".xla", Newer version ".xlsx")
    • Excel VBA Object Model: Excel, Word, AutoCad ® သာမက VBA သံုးႏိုင္တဲ့ Applications ေတြ မွာ Object Model ေတြရွိပါတယ္။ ဒါမွ VBA ကေန လုပ္ေဆာင္ရမဲ့၊ လုပ္ေဆာင္ႏိုင္တဲ့ နည္းလမ္းေတြ ကို ရွာေဖြ ႏိုင္ဘို႔ပါ။
    • Macro Security
    • Function and Sub: Sub ဆိုတာ ကေတာ့ macro အေနနဲ႔ တိုက္ရိုက္ run လို႔ရတဲ့ processes ေတြပါ။ ပါဝင္တဲ့ နည္းလမ္း အခ်ိဳ႕ ကို modify လုပ္ဘို႔ လိုတဲ့ အခါ macro record လုပ္ၿပီး မီွျငမ္းေလ့လာႏိုင္ပါတယ္။ Form ေတြပါ ဒီဇိုင္းလုပ္ၿပီး Graphical User Interface နဲ႔ သံုးစြဲႏိုင္ပါတယ္။ အခုတင္ျပမွာ ကေတာ့ ဒီ Sub အေၾကာင္း မဟုတ္ပါဘူး။ Excel Spread Sheet ထဲမွာ Function အေနနဲ႔ တိုက္ရိုက္ Insert လုပ္ သံုးႏိုင္မဲ့ Function ေတြအေၾကာင္းပါ။

  3. HVAC Air-Side Circular Duct Sizing Calculations (SI Units)
    • Cold Air Standard အတြက္ သံုးရမဲ့ Duct အရြယ္အစား ေရြးခ်ယ္တဲ့ နည္းပါ။ ဒီနည္း နဲ႔ Pressure Loss ကို တြက္ထုတ္ ရင္ ရမဲ့ Duct Pressure Loss အေျဖက ± 5% အတြင္းမွာ ရွိပါတယ္။ သူ႕ကို သံုးႏိုင္တဲ့ Conditions ေတြကေတာ့။
      • Temperature: 5 to 35 °C
      • Elevation: 0 to 500m
      • Duct Pressure: -5 to 5 kPa relative to ambient pressure
    • ဒီ အေျခအေန ေတြ က ပံုမွန္ HVAC အတြက္ လံုေလာက္ပါတယ္။
    • အမ်ားအားျဖင့္ Constraints ႏွစ္ခုရွိပါတယ္။ Velocity နဲ႔ Friction Loss ပါ။ ဒါေၾကာင့္ Duct Size လုပ္တဲ့ အခါ Velocity ကိုပဲ သံုးရင္ မွားတတ္ပါတယ္။
    • Velocity Limits ေတြ နဲ႔ပတ္သက္ၿပီး Basic Duct Sizing Consideration ေတြကုိ M&E Basics: Pipe & Duct Sizing မွာေလ့လာပါ။ (မွတ္ခ်က္၊ ၊ Ducting နဲ႔ Piping ကို သီးသန္႔ျပန္ခြဲ ဘို႔ စီစဥ္ေနပါတယ္။)
    • ပထမဆံုး Circular Duct Size ကို တြက္ဘို႔ Function ကိုေရးရပါမယ္။
    • အသံုးျပဳမဲ့ Calculation Formulae ေတြကို ေတာ့ ASHRAE Handbook: Fundamental ထဲကေန မွီျငမ္းထားပါတယ္။



    • တြက္နည္း အဆင့္ဆင့္ ကေတာ့၊
      • သတ္မွတ္ထားတဲ့ Velocity အတြင္းဝင္တဲ့ Duct Size ကိုတြက္မယ္။
      • ဒီ Duct Size နဲ႔ တြက္ရင္ ရမဲ့ Pressure Loss ကိုတြက္ၿပီး သတ္မွတ္ထားတဲ့ Limit အတြင္းရွိမရွိ ၾကည့္မယ္။ ဝင္ေနတယ္ ဆိုရင္ အေျဖရပါၿပီ။
      • Limit အတြင္း မဟုတ္ေသး ရင္ေတာ့ သတ္မွတ္ထားတဲ့ Pressure Loss Limit အတြင္း မဝင္မခ်င္း Duct Size ကိုျပန္ေရြး၊ ျပန္တြက္ လုပ္ရပါမယ္။

    • ဒီ Function ကိုေရးတဲ့ အခါ တြက္ရ ပုိၿပီးလြယ္ ကူေအာင္ အကူ Functions ခြဲႏွစ္ခု ပါ ထည့္ေရးထားပါတယ္။ ဒီ Functions သံုးခု ေပါင္းမွ အလုပ္ လုပ္ပါလိမ့္မယ္။
      1. DuctSize_Cir_mm : Circular Duct Size ကို တြက္ထုတ္ဘို႔ပါ။
      2. DuctFrictionLoss_Pa: Circular Duct Frictioin Loss ကို တြက္ထုတ္ဘို႔ပါ။
      3. f_Colebrook: Colebrook's Friction Factor ကို တြက္ထုတ္ဘို႔ပါ။

    • Flowcharts ေတြ ကို ေရးမယ္ဆိုရင္ ဒီလိုေတြ႕ရပါမယ္။
      1. DuctSize_Cir_mm

      2. DuctFrictionLoss_Pa

      3. f_Colebrook


    • ဒီနည္း ကို Numerical Programming နဲ႔တြက္ဘို႔ VBA Code ကို ေရးရပါတယ္။ Excel ထဲက Visual Basic Editor ေအာက္မွာပါ။ သီးသန္႔ ".xla" အျဖစ္နဲ႔ ထားၿပီး Excel အစမွာ တက္ဘို႔ ထားထားတဲ့ XLStart ဆိုတဲ့ Folder ကိုရွာၿပီး ထည့္ခ်င္ထည့္၊ “personal.xls” ဆိုတဲ့ File ထဲမွာပဲ ျဖစ္ျဖစ္ ထားလို႔ရပါတယ္။
    • VBA က Macro Security Level ေပၚမူတည္ ၿပီး အလုပ္လုပ္ခြင့္ ေပးရပါတယ္။ Powerful Operation ေတြမို႔ Macro Security အေၾကာင္းကို ေသေသခ်ာခ်ာ ေလ့လာ သိရွိထားဘို႔ လိုအပ္ပါတယ္။
    • "personal.xls" ဆိုတာ မရွိေသးရင္ေတာ့ ပထမ Record New Macro လုပ္၊ စာတစ္လံုး ႏွစ္လံုးရိုက္၊ ဟုိႏွိပ္ဒီႏွိပ္ လုပ္ၿပီး Stop Macro ကိုႏွိပ္၊ ၿပီးလို႔ Visual Basic Editor ကို ဖြင့္လိုက္ရင္ "personal.xls" တက္လာတာ ေတြ႕ရပါလိမ့္မယ္။


    • ေအာက္ဆံုး ပိုင္း မွာ Excel 2003 နဲ႔ Excel 2007 က Screenshots အခ်ိဳ႕ကို ထည့္သြင္း ေပးထားပါတယ္။


    • Visual Basic Editor မွာ Module ကို ကိုယ္ႏွစ္သက္သလို နာမည္ေပး e.g. AirDuct ၿပီးရင္ Code ေနရာမွာ ေအာက္က Code ေတြကို Copy & Paste လုပ္ဘို႔ပါ။
    • 'General Section Declaration
      Option Base 0 'array base
      Option Compare Text
      Private Const atm As Double = 101.325 ' Atmospheric pressure in kPA
      Public Const pi As Double = 3.14159265358979



    1. Function DuctSize_Cir_mm(Air_cmh, Optional dP_Pa = 1, Optional V_mps = 8, Optional e_mm = 0.09)
      'Calculate Circular Duct Size, Default for 1Pa/m, 8 m/s and Medium Surface Roughness 0.09mm
      Dim dV As Double, dD As Double, dA As Double
      Dim dP As Double

      'calc Area which satisfy the velocity limits
      dV = V_mps
      dA = Air_cmh / (3600# * dV)
      dD = (4 * dA / pi) ^ 0.5 * 1000

      'call function for Friction Loss
      dP = DuctFrictionLoss_Pa(Air_cmh, dD, e_mm)

      If dP > dP_Pa Then
      Do
      'Use Power rule estimation for iteration
      dD = dD * (dP / dP_Pa) ^ 0.25
      dP = DuctFrictionLoss_Pa(Air_cmh, dD, e_mm)
      'exit error 1%
      If Abs((dP - dP_Pa) / dP_Pa) < 0.01 Then Exit Do
      Loop
      End If
      DuctSize_Cir_mm = dD
      End Function

    2. Function DuctFrictionLoss_Pa(Air_cmh, DuctDia_mm, Optional e_mm = 0.09)
      'Calculate Friction Loss
      Dim dQ As Double, dD As Double 'flowrate (m3/s), diameter(mm)
      Dim dV As Double, dF As Double 'velocity (m/s), friction factor
      Dim dM As Double, dE As Double 'density (kg/m3), surface roughness
      Dim Re As Double, dA As Double

      'For Cold Air Standard at density=1.2kg/m3
      If Air_cmh * DuctDia_mm > 0 Then
      dQ = Air_cmh / 3600# 'convert air flowrate to m3/s
      dD = DuctDia_mm
      dM = 1.2 'kg/m3 for cold air std
      dA = 0.25 * pi * (dD / 1000#) ^ 2
      dV = dQ / dA 'v=Q/A
      Re = 66.4 * dD * dV 'Ref ASHRAE: or use Re = V * d / nu
      dF = f_Colebrook(e_mm / dD, Re)
      DuctFrictionLoss_Pa = 500 * dF * dM * dV * dV / dD
      Else
      DuctFrictionLoss_Pa = 0
      End If
      End Function

    3. Function f_Colebrook(e_by_D, Re) 'e_by_D Relative roughness; Dh: Hydraulic Dia, Re: Reynold number
      'Calculate Colebrook friction Factor

      Dim f As Double, root_f As Double, root_f1 As Double

      'Start with Tsal's estimation
      f = 0.11 * (e_by_D + 68 / Re) ^ 0.25
      If f < 0.018 Then
      f = 0.85 * f + 0.0028
      End If

      root_f = f ^ 0.5
      Do
      root_f1 = -0.5 * Log(10) / Log(e_by_D / 3.7 + 2.51 / (root_f * Re))
      'check if error is less than 0.5%
      If Abs((root_f1 - root_f) / root_f) < 0.005 Then Exit Do
      root_f = 0.5 * (root_f + root_f1) 'Use binary approach iteration
      Loop
      f_Colebrook = root_f ^ 2
      End Function



  4. Use of VBA Functions in Excel Worksheet
    • ၿပီးရင္ေတာ့ ဒီ Function ေတြကို Excel Spreadsheet မွာ အသင့္သံုးႏိုင္ပါၿပီ။
    • ပထမ Insert function ကိုသြားၿပီး select a category မွာ User Defined ကိုေရြးလိုက္ရင္ ဒီ Function ေတြ ေပၚလာပါလိမ့္မယ္။

    • ၿပီးရင္ေတာ့ Excel Formula သံုးေနက် အတိုင္းသံုးရံုပါပဲ။
      ဒီအထဲ မွာ Air_cmh ဆိုတဲ့ ကြက္လပ္ကိုေတာ့ ျဖည့္ကို ျဖည့္ရပါမယ္။ အျခား ကြက္လပ္ေတြ ကို Function မွာထဲ က Optional အေနနဲ႔ ေရြးၿပီး Assign လုပ္ထားတာမို႔ မျဖည့္လည္း ရပါတယ္။ Assigned လုပ္ခဲ့တဲ့ value ေတြကေတာ့ အသံုးမ်ားတဲ့
      • dP_Pa = 1
      • V_mps = 8
      • E_mm = 0.09

    • ၿပီး Excel Style: Drag-Coppy လုပ္လိုက္ရင္ ရမဲ့ အေျဖကေတာ့၊


    • ဒီကရတဲ့ အေျဖက Chart ကေနၾကည့္လို႔ ရတဲ့ အေျဖနဲ႔ အတူတူေလာက္ပါပဲ။ တကယ္ အေသးစိတ္ တြက္လို႔ ရမဲ့ အေျဖရဲ့ ± 1% အတြင္းမွာ ရွိတာမို႔ safety factor ထည့္ယူေလ့ရွိတဲ့ အင္ဂ်င္နီယာ ေတြအတြက္ လံုေလာက္ပါတယ္။
      မွတ္ခ်က္။ ။ Excel Calculation Sheet File ေတြကို ေပးတဲ့ အခါမွာေတာ့ ဒီ Function ေတြ အဲဒီ file ထဲမွာ မပါရင္ အလုပ္လုပ္ မွာ မဟုတ္ပါဘူး။ စကားေၾကာ မရွည္ အပို ရွင္းမျပ ခ်င္ရင္ ဒီ Function ေတြ နဲ႔တြက္ ၿပီး ရလာတဲ့ အေျဖ ရွိတဲ့ Cell ေတြက အေျဖ ကို Copy ကူး၊ ၿပီး Paste Special မွာ values ကို ေရြးၿပီး ျပန္ထည့္လိုက္ပါ။


  5. Non Circular Duct Sizing Calculations
    • HVAC Air-Side မွာသံုးေလ့ ရွိတဲ့ Air Duct အမ်ိဳးအစား သံုးခု ကို ေအာက္မွာ ေဖာ္ျပထားပါတယ္။
    • Circular Duct မဟုတ္တဲ့ အျခား Duct ေတြ ကို သံုးတဲ့ အခါ အသင့္ေတာ္ဆံုး ကေတာ့ Equivalent Circular Duct ကိုရွာၿပီး တြက္တဲ့ နည္းပါ။

      1. Rectangular Duct ရဲ့ Equivalent Diameter ရွာမဲ့ Function ကိုသံုးႏိုင္ဘို႔ VBA Code ကိုေအာက္မွာ ေဖာ္ျပေပးထားပါတယ္။
        Function DuctR2C(dH, dW) As Double
        'Rectangular Duct to Circular Duct
        If dW * dH > 0 Then
        DuctR2C = 1.3 * ((dH * dW) ^ 0.625) / ((dH + dW) ^ 0.25)
        Else
        DuctR2C = 0
        End If
        End Function


      2. Oval Duct ရဲ့ Equivalent Diameter ရွာမဲ့ Function ကိုသံုးႏိုင္ဘို႔ VBA Code ကိုေအာက္မွာ ေဖာ္ျပေပးထားပါတယ္။
        Function DuctO2C(dH, dW) As Double
        'Oval Duct to Circular Duct
        Dim dA As Double, P As Double
        If dW * dH > 0 Then
        dA = (pi * dH ^ 2 / 4) + dH * (dW - dH)
        P = pi * dH + 2 * (dW - dH)
        DuctO2C = 1.55 * (dA ^ 0.625) / (P ^ 0.25)
        Else
        DuctO2C = 0
        End If
        End Function

      3. Circular Duct ကေန Equivalent Rectangular Duct Size ရွာမဲ့ Function ကိုသံုးႏိုင္ဘို႔ VBA Code ကိုေအာက္မွာ ေဖာ္ျပေပးထားပါတယ္။
        Function DuctC2R(dD, Optional dH = 0) As Double
        'Circular Duct to Rectangular Duct
        'if Dimension (dH) is zero, square duct
        'dH could be either dimension: "Width" or "Height"
        Dim dW As Double, dW1 As Double
        Dim dD1 As Double

        If dH > 0 Then
        'Estimate dH
        dW = 0.25 * pi * dD * dD / dH
        Do
        dD1 = 1.3 * ((dH * dW) ^ 0.625) / ((dH + dW) ^ 0.25)
        dW = dW * (dD / dD1) ^ 2
        If Abs((dD1 - dD) / dD) < 0.005 Then Exit Do
        Loop
        Else
        dW = dD * 0.9148
        End If
        DuctC2R = dW
        End Function


      4. Circular Duct ကေန Equivalent Oval Duct Size ရွာမဲ့ Functionကိုသံုးႏိုင္ဘို႔ VBA Code ကိုေအာက္မွာ ေဖာ္ျပေပးထားပါတယ္။
        Function DuctC2O_Width(dD, Optional dH = 0) As Double
        'Circular Duct to Rectangular Duct
        'if Dimension (dH) is zero, square duct + round, ie, a = 2 * b
        'dH is dimension b for "Height", dW is dimension a for "Width"
        'As nature, dH < dD
        Dim dW As Double, dW1 As Double
        Dim dD1 As Double
        Dim dA As Double, P As Double

        If dH > 0 Then
        'Estimate dH
        dW = 0.25 * pi * (dD * dD - dH * dH) / dH
        Do
        dA = (pi * dH ^ 2 / 4) + dH * (dW - dH)
        P = pi * dH + 2 * (dW - dH)
        dD1 = 1.55 * (dA ^ 0.625) / (P ^ 0.25)
        dW = dW * (dD / dD1) ^ 2
        If Abs((dD1 - dD) / dD) < 0.005 Then Exit Do
        Loop
        Else
        dW = dD / 1.5234
        End If
        DuctC2O_Width = dW
        End Function


    • Duct Design ကိုလိုက္လို႔ ရႏိုင္မဲ့ Air Flow Limits ကိုတြက္ႏိုင္ဘို႔ Function သံုးခုကို ေအာက္မွာ ေပးထားပါတယ္။

      1. Function DuctAirFlow_Cir_cmh(dD_mm, Optional dP_Pa = 1, Optional dV_mps = 9, Optional e_mm = 0.09)
        Dim cmh As Double, dP As Double
        Dim dD As Double, dV As Double

        dV = dV_mps
        dD = dD_mm
        cmh = 0.0009 * pi * dD * dD * dV '0.0009 <- 0.25*3600/1000000
        dP = DuctFrictionLoss_Pa(cmh, dD, e_mm)
        If dP > dP_Pa Then
        Do
        dV = dV * (dP_Pa / dP) ^ 0.5
        cmh = 0.0009 * pi * dD * dD * dV
        dP = DuctFrictionLoss_Pa(cmh, dD, e_mm)
        If Abs(dP - dP_Pa) / dP_Pa < 0.01 Then Exit Do
        Loop
        End If
        DuctAirFlow_Cir_cmh = cmh
        End Function


      2. Function DuctAirFlow_Rec_cmh(dW_mm, dH_mm, Optional dP_Pa = 1, Optional dV_mps = 9, Optional e_mm = 0.09)
        Dim dD As Double, dV As Double
        dV = dV_mps
        dD = DuctR2C(dW_mm, dH_mm)
        DuctAirFlow_Rec_cmh = DuctAirFlow_Cir_cmh(dD, dP_Pa, dV_mps, e_mm)
        End Function


      3. Function DuctAirFlow_Oval_cmh(dW_mm, dH_mm, Optional dP_Pa = 1, Optional dV_mps = 9, Optional e_mm = 0.09)
        Dim dD As Double, dV As Double
        dV = dV_mps
        dD = DuctO2C(dW_mm, dH_mm)
        DuctAirFlow_Oval_cmh = DuctAirFlow_Cir_cmh(dD, dP_Pa, dV_mps, e_mm)
        End Function




  6. Screenshots of Adding VBA Codes in Excel
    • Excel 2002-2003 (or Earlier)
      • နမူနာ အေနနဲ႔ Microsoft Excel 2002-2003 မွာဆိုရင္ေတာ့ ဒီလိုေတြ႕ရပါလိမ့္မယ္။

      • Visual Basic Editor ဆိုတာ ကို ႏွိပ္လိုက္ရင္ ေအာက္က ပံုစံ ေပၚလာပါလိမ့္မယ္။ အထဲမွာ VBA Code ေတြ ကို ကူးယူၿပီးရင္ ဒီလို ေတြ႔ႏိုင္ပါတယ္။



    • Excel 2007
      • 2007 အထက္ ဆိုရင္ေတာ့ Tools အစား Developer Tab အေနနဲ႔ ဝင္လာပါတယ္။


      • တစ္ခါတစ္ရံ Developer Tab ကို ေဖ်ာက္ ထားတတ္ပါေသးတယ္။ ဒါဆိုရင္ ေတာ့ excel option ေအာက္ကေန သြားရွာ ရပါလိမ့္မယ္။ (မေသခ်ာ ရင္ Help မွာ ရွာၾကည့္ပါ။)




      • အထက္မွာ ေျပာခဲ့တဲ့ အတိုင္း VBA က Macro Security Level ေပၚမူတည္ ၿပီး အလုပ္လုပ္ခြင့္ ေပးရပါတယ္။ Powerful Operation ေတြမို႔ Macro Security အေၾကာင္းကို ေသေသခ်ာခ်ာ ေလ့လာ သိရွိထားဘို႔ လိုအပ္ပါတယ္။


      • Developer Tab ေအာက္ က Code ေနရာ မွာ လည္း Macro Security ဆိုတာ ရွိပါတယ္။ ထြက္လာမဲ့ Screen ကေတာ့ အေပၚက ပံုအတိုင္းပါပဲ။




  7. VBA Code to show VBA functions in html
    • အေပၚက VBA code ေတြမွာ အေရာင္ေတြ ခြဲေပးထားတာ က လည္း VBA ကို သံုးၿပီး html format ကို ေပးထားလို႔ပါ။ ဒါကိုေတာ့ MS Word ေအာက္မွာ ေရးၿပီးသံုးပါတယ္။ အပို သိပ္မပါပဲ ရွင္းရွင္းလင္းလင္း ျမင္ရေအာင္ format လုပ္ဘို႔က html မွာသိပ္မလြယ္ ပါဘူး။ အခ်ိန္လည္း အရမ္းကုန္ပါတယ္။

No comments: