軟體:excel
版本:2007
版上前輩好
小弟手中資料因為含有不同單位並且沒有依固定格式排列
現在想要把它統一轉換成同一種單位刻度,並且只有數字格式
例如 208uA -> 0.208 (mA)
123456nA -> 0.123456 (mA)
現在的想法是利用"尋找與取代"的形式來實現
但是雖然單位消掉了,可是卻卡在 do while 的迴圈出不來
想請各位前輩指導一下如何解決
目前程式如下~
Cells.Find(What:="uA", After:=ActiveCell, LookIn:=xlFormulas, LookAt:= _
xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext,MatchCase:=False _
, MatchByte:=False, SearchFormat:=False).Activate
Do While ActiveCell <> ""
ActiveCell.Replace What:="uA", Replacement:=""
ActiveCell = ActiveCell / 1000
Cells.FindNext(After:=ActiveCell).Activate
Loop
Cells.Find(What:="nA", After:=ActiveCell, LookIn:=xlFormulas, LookAt:= _
xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext,MatchCase:=False _
, MatchByte:=False, SearchFormat:=False).Activate
Do While ActiveCell <> ""
ActiveCell.Replace What:="nA", Replacement:=""
ActiveCell = ActiveCell / 100000
Cells.FindNext(After:=ActiveCell).Activate
Loop
現在可以順利將 uA 的單位取代掉並且 /1000
但是卻卡在 "Cells.FindNext(After:=ActiveCell).Activate" 出不來
會有"沒有設定變數或 with 區塊變數" 這個錯誤
拜託大家幫忙了~謝謝