ªð¦^¦Cªí ¤W¤@¥DÃD µo©«

ENVIRON环¹Ò参数

ENVIRON环¹Ò参数

On Error Resume Next
Dim arr(), i As Integer
i = 1
Do
ReDim Preserve arr(1 To 2, 1 To i)
arr(1, i) = Split(environ(i), "=")(0)
arr(2, i) = Split(environ(i), "=")(1)
i = i + 1
Loop Until environ(i) = ""
Range("a1").Resize(UBound(arr, 2), 2) = Application.WorksheetFunction.Transpose(arr)
学习

¦^´_ 1# wqfzqgk
§A´£¨Ñªºµ{¦¡½X¤¤
·í i=22 ®É   Split(environ(i), "=")(1) ªº¦r¤¸¼Æ¬°294 >255 ¦b°}¦C¤¤µLªkÂà¸m
¾É­P    Range("a1").Resize(UBound(arr, 2), 2) = Application.WorksheetFunction.Transpose(arr)
²£¥Í¿ù»~­È §A¥Î On Error Resume Next ¤]µLªk®ø°£
¦p¥Î Range("a1").Resize( 2, UBound(arr, 2)) = arr  ¤£¨Ï¥ÎÂà¸m ¨S¦³¿ù»~¥X²{
  1. Sub Ex()
  2.     Dim i As Integer
  3.     i = 1
  4.     Do
  5.         Cells(i, 1) = Split(Environ(i), "=")(0)
  6.         Cells(i, 2) = Split(Environ(i), "=")(1)
  7.         i = i + 1
  8.     Loop Until Environ(i) = ""
  9. End Sub
½Æ»s¥N½X

TOP

¬Ý来¬O这个¨ç数ªº¨Æ
学习

TOP

        ÀR«ä¦Û¦b : ¡i¥Í©R¦b©I§l¶¡¡j¦òªû»¡¡G¡u¥Í©R¦b©I§l¶¡¡C¡v¤HµLªkºÞ¦í¦Û¤vªº¥Í©R¡A§óµLªk¾×¦í¦º´Á¡AÅý¦Û¤v¥Ã¦í¤H¶¡¡C¬JµM¥Í©R¥h¨Ó³o»òµL±`¡A§Ú­Ì§óÀ³¸Ó¦n¦n¦a·R±¤¥¦¡B§Q¥Î¥¦¡B¥R¹ê¥¦¡AÅý³oµL±`¡BÄ_¶Qªº¥Í©R¡A´²µo¥¦¯uµ½¬üªº¥ú½÷¡A¬M·Ó¥X¥Í©R¯u¥¿ªº»ù­È¡C
ªð¦^¦Cªí ¤W¤@¥DÃD