まぁこのくらいならVBAの方が単純ですね。
Sub ClearInputCells() For i = 4 To 82 Step 2 Range("D" & i, "BA" & i).Select Selection.ClearContents Next i End Sub
<DnaLibrary Name="FSharp Sample" Language="F#"> <![CDATA[ #light module fsExcelSample open ExcelDna.Integration let range = [ for r in [2..41] do for c in [4..100] -> (r*2, c)] [<ExcelCommand(MenuName="&ClearInputCells", MenuText="&ClearInputCells")>] let clearInputCells () = range |> List.iter (fun (row, col) -> let row, col = row - 1, col - 1 let cell = ExcelReference(row, col) cell.SetValue("") |> ignore ) ]]> </DnaLibrary>
参考にさせていただいたサイト。
http://d.hatena.ne.jp/bleis-tift/20110713/1310490680