返回列表 上一主題 發帖

[發問] 如何設一按鈕,就能把公式轉換過的值,取代原有的值?

回復 1# iceandy6150

試用看看? 我想應該還會有人寫的比我更簡短吧。
如果B的 電機、油漆...等,都是固定在前面兩個,我想只需要使用MID就可。
  1. Sub test()
  2. x = [A1].CurrentRegion.Rows.Count
  3. For i = 2 To x
  4.     Cells(i, "B") = Mid(Cells(i, "B"), 1, 2)
  5.     y = Application.Substitute(Cells(i, "C"), "日", ":")
  6.     y = Application.Substitute(y, "月", ":")
  7.     y = Application.Substitute(y, "年", ":")
  8.     Cells(i, "C") = Application.Text(y, "hh年mm月ss日")
  9. Next i
  10. End Sub
複製代碼

TOP

        靜思自在 : 話多不如話少,話少不如話好。
返回列表 上一主題