7,763
社区成员
发帖
与我相关
我的任务
分享
Option Explicit
Private Sub Command1_Click()
Debug.Print map(1, 0, 100, 1000, 2000)
End Sub
Private Function map(value As Double, fromLow As Double, fromHigh As Double, toLow As Double, toHigh As Double) As Double
map = (value - fromLow) / (fromHigh - fromLow) * (toHigh - toLow) + toLow
End Function