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

transfer string to number(¤p°ÝÃD½Ð±Ð)

transfer string to number(¤p°ÝÃD½Ð±Ð)

¥»©«³Ì«á¥Ñ jj369963 ©ó 2013-10-20 19:29 ½s¿è

Dear ¦U¦ì¤j¤j»P«e½ú­Ì¡G

¦pªþÀÉ¡A·Q±NDÄæ¨ìCOÄæ¦ìÂন¼Æ¦r®æ¦¡¡A¥Ø«e¥Î¥H¤U¥N½X¸Õ¹L¦¨¥\¡Abut ¬O­n¤@­Ó¤@­Ó¼g¨ìCOÄæ¶Ü?
½Ð°Ý¬O§_¦³¨ä¥L¤è¦¡?µo°Ý¬O¶i¨Bªº­ì°Ê¤O¡A¦A·Ð½Ð¦U¦ì¥ý½ú«ü±Ð¡A·PÁÂ
  1. Sub transfer()
  2. Dim RngHead As Range, DataCunt As Long, i As Long
  3. Set RngHead = Range("A2")
  4. DataCunt = Range("A65536").End(xlUp).Row
  5. Application.ScreenUpdating = False
  6. For i = RngHead.Row To DataCunt
  7.     If Val(Range("A" & i).Value) <> 0 Then
  8.    Range("A" & i).NumberFormatLocal = "G/³q¥Î®æ¦¡"
  9.    Range("A" & i).Value = Val(Range("A" & i).Value)
  10.     End If
  11.     If Val(Range("F" & i).Value) <> 0 Then
  12.    Range("F" & i).NumberFormatLocal = "G/³q¥Î®æ¦¡"
  13.    Range("F" & i).Value = Val(Range("F" & i).Value)
  14.     End If
  15.     If Val(Range("G" & i).Value) <> 0 Then
  16.    Range("G" & i).NumberFormatLocal = "G/³q¥Î®æ¦¡"
  17.    Range("G" & i).Value = Val(Range("G" & i).Value)
  18.     End If
  19.     If Val(Range("H" & i).Value) <> 0 Then
  20.    Range("H" & i).NumberFormatLocal = "G/³q¥Î®æ¦¡"
  21.    Range("H" & i).Value = Val(Range("G" & i).Value)
  22.     End If
  23.     If Val(Range("I" & i).Value) <> 0 Then
  24.    Range("I" & i).NumberFormatLocal = "G/³q¥Î®æ¦¡"
  25.    Range("I" & i).Value = Val(Range("G" & i).Value)
  26.     End If
  27.     If Val(Range("J" & i).Value) <> 0 Then
  28.    Range("J" & i).NumberFormatLocal = "G/³q¥Î®æ¦¡"
  29.    Range("J" & i).Value = Val(Range("G" & i).Value)
  30.     End If
  31. Next i
  32. End Sub
½Æ»s¥N½X
trasfer number.rar (221.16 KB)

Dear ¦U¦ì¤j¤j»P«e½ú­Ì¡G

¦pªþÀÉ¡A·Q±NDÄæ¨ìCOÄæ¦ìÂন¼Æ¦r®æ¦¡¡A¥Ø«e¥Î¥H¤U¥N½X¸Õ¹L¦¨¥\¡Abut ¬O­n¤@­Ó ...
jj369963 µoªí©ó 2013-10-20 19:27

ÃöÁä¬Oµ½¥Î Union »P For Each ¨ç¼Æ :
  1. Sub tf()
  2.   Dim rTar As Range, RngHead As Range
  3.   Dim DataCunt As Long
  4.   Dim vTar
  5.   
  6.   Set RngHead = Range("A2")
  7.   DataCunt = Range("A65536").End(xlUp).Row
  8.   Set rTar = Union(Range(RngHead.Address & ":A" & DataCunt), Range("F" & RngHead.Row & ":J" & DataCunt))
  9.   For Each vTar In rTar
  10.     With vTar
  11.       If .Value <> 0 Then
  12.        .NumberFormatLocal = "G/³q¥Î®æ¦¡"
  13.        .Value = Val(.Value)
  14.       End If
  15.     End With
  16.   Next vTar
  17. End Sub
½Æ»s¥N½X
trasfer number-a.zip (404.62 KB)

TOP

        ÀR«ä¦Û¦b : ·O´d¨S¦³¼Ä¤H¡A´¼¼z¤£°_·Ð´o¡C
ªð¦^¦Cªí ¤W¤@¥DÃD