pp 發問時間: 電腦與網際網路程式設計 · 9 年前

字串太長要如何處理

大大:

若在VBA中字串太長要如何分行顯示,才不會看不到程式碼

例如:

mytitle = "Carrier_No,Work_No,IG_No,Judge,Pre_Freq_H1(MHz),Pre_CI_H1(Ohm),Pre_dF_H1(ppm),Add_Pre_Freq_H1(MHz),Post_Freq_H1(MHz),Post_CI_H1(Ohm),Post_dF_H1(ppm),Time_H1(sec),Rate_H1(ppm/sec),K_H1,End_A_H1,End_B_H1,Adj_dF_H1(ppm),IG_No,Judge,Pre_Freq_H2(MHz),Pre_CI_H2(Ohm),Pre_dF_H2(ppm),Add_Pre_Freq_H2(MHz),Post_Freq_H2(MHz),Post_CI_H2(Ohm),Post_dF_H2(ppm),Time_H2(sec),Rate_H2(ppm/sec),K_H2,End_A_H2,End_B_H2,Adj_dF_H2(ppm),IG_No,Judge,Pre_Freq_L1(MHz),Pre_CI_L1(Ohm),Pre_dF_L1(ppm),Add_Pre_Freq_L1(MHz),Post_Freq_L1(MHz),Post_CI_L1(Ohm),Post_dF_L1(ppm),Time_L1(sec),Rate_L1(ppm/sec),K_L1,End_A_L1,End_B_L1,Adj_dF_L1(ppm),IG_No,Judge,Pre_Freq_L2(MHz),Pre_CI_L2(Ohm),Pre_dF_L2(ppm),Add_Pre_Freq_L2(MHz),Post_Freq_L2(MHz),Post_CI_L2(Ohm),Post_dF_L2(ppm),Time_L2(sec),Rate_L2(ppm/sec),K_L2 ,End_A_L2,End_B_L2,Adj_dF_L2(ppm)"

vSht.Range("A1:BJ1") = Split(mytitle, ",")

mytitle是抬頭欄

2 個解答

評分
  • jan
    Lv 4
    9 年前
    最佳解答

    分段整理吧!

    mytitle = "Carrier_No,Work_No,IG_No,Judge,Pre_Freq_H1(MHz)," & _

    "Pre_CI_H1(Ohm),Pre_dF_H1(ppm),Add_Pre_Freq_H1(MHz), " & _

    ...........

  • 匿名使用者
    6 年前

    到下面的網址看看吧

    ▶▶http://qoozoo09260.pixnet.net/blog

還有問題?馬上發問,尋求解答。