unityaiueo-blog
unityaiueo-blog
題名未設定
22 posts
Don't wanna be here? Send us removal request.
unityaiueo-blog · 5 years ago
Text
Google App Script msgBox()
Google App Script msgBox()
function initSheet(){ var sheet=SpreadsheetApp.getActiveSheet(); //sheet変数に現在使われているシートをいれる var names=[‘taguchi’,’huziko’,’takeda’]; var i; var scores=[]; if(Browser.msgBox(‘シートの初期化’,’実行していいですか?’,Browser.Buttons.OK_CANCEL) ===’cansel’){ //スクリプトが走る時確認メッセージが出る return; } sheet.clear(); //消す for(i=1;i<=10;i++){ scores.push([//配列の要素を入れ込む names[Math.floor(Math.random()names.legnth)]…
View On WordPress
0 notes
unityaiueo-blog · 5 years ago
Text
Google App Script 配列2
Google App Script 配列2
function initSheet(){ var sheet=SpreadsheetApp.getActiveSheet(); //sheet変数に現在使われているシートをいれる var names=[‘taguchi’,’huziko’,’takeda’]; var i; var scores=[];
//sheet.clear(); //消す for(i=1;i<=10;i++){ scores.push([//配列の要素を入れ込む names[Math.floor(Math.random()names.legnth)], Math.floor(Math.random()101) ]); } sheet.getRange(1,1,10,2).setValues(scores);//1行目1列から1000行文2列分 } function…
View On WordPress
0 notes
unityaiueo-blog · 5 years ago
Text
Google App Script 配列
Google App Script 配列
function initSheet(){ var sheet=SpreadsheetApp.getActiveSheet(); //sheet変数に現在使われているシートをいれる var names=[‘taguchi’,’huziko’,’takeda’]; var i; var startTime=new Date(); sheet.clear(); //消す for(i=1;i<=1000;i++){ sheet.getRange(i,1).setValue(names[Math.floor(Math.random()*names.length)]);//i行目1列目にランダムで名前いれるMath.floorで小数点切り捨て sheet.getRange(i,2).setValue(Math.floor(Math.random()*101)); } Logger.…
View On WordPress
0 notes
unityaiueo-blog · 5 years ago
Text
Google App Script シートの操作
Google App Script シートの操作
function initSheet(){ var sheet=SpreadsheetApp.getActiveSheet(); //sheet変数に現在使われているシートをいれる
sheet.clear(); //消す
sheet.getRange(1,1).setValue(‘taguchi’); sheet.getRange(1,2).setValue(82).setBackground(‘tomato’); //赤くする処理
}
View On WordPress
0 notes
unityaiueo-blog · 5 years ago
Text
Google App Script 関数
Google App Script 関数
function GETRESULT(input){ if(input.map){ return input.map(GETRESULT); }else{ return input >=80 ? ‘PASS’:’FAIL’; }
/if(input >=80){ return ‘PASS’; }else{ return ‘FAIL’; }/ }
Logger.log(‘hello’)
スプレッドシートの方で出力したい場所に =メソッド名(使いたいセル番号)で利用可能
Logger.logで出力可能
View On WordPress
0 notes
unityaiueo-blog · 5 years ago
Text
VBA Integr型
Option Explicit
Sub VariableTest() Dim x As Integer ‘Dim、変数名、型の順で書く’ x = 10 ‘Range(“A1”).Value = x x = 10 + 5 x = x + 1 x = 2 ^ 3 ‘2の3乗’ Debug.Print x ‘値の確認をしたいだけの時’ End Sub
View On WordPress
0 notes
unityaiueo-blog · 5 years ago
Text
VBA メソッド
Option Explicit
Sub MethodTest() Range(“B2”).Clear ‘ 指定した場所を消す’ Range(“B5”).Delete shift:=xlShiftUp ‘B5を消し上う方向に詰める’ Worksheets.Add after:=Worksheets(“Sheet2”), Count:=2 ‘ワークシートを二枚追加する処理’ End Sub
View On WordPress
0 notes
unityaiueo-blog · 5 years ago
Text
VBA セルの値を取得
Option Explicit
Sub GetTest() MsgBox (Range(“A1”).Value) MsgBox (Range(“A1”).FonSize) End Sub
View On WordPress
0 notes
unityaiueo-blog · 5 years ago
Text
VBA With
Option Explicit
Sub WithTest() Range(“A1”).Value = “Hello” Range(“A1”).Font.Bold = True Range(“A1”).Font.Size = 16 Range(“A1”).Interior.Color = vbRed End Sub
Sub WithTest2() ‘A2にSizeを16にして色を赤くして太字(Bold)にしてHelloを出力,withを使えばこう書ける’ With Range(“A2”) .Value = “Hello” With .Font .Bold = True .Size = 16 End With .Interior.Color = vbRed End With
View On WordPress
0 notes
unityaiueo-blog · 5 years ago
Text
VBA 複数セルに値を表示
Option Explicit
Sub CellsChange() Range(“A1”, “B3”).Value = “Hello” ‘A1からB3までHello挿入’ Range(“A5”, “C7”).Value = “Hello2” Range(“4:4”).Value = “row 4” ‘4行目だけ挿入’ Range(“C:C”).Value = “ColumnC” ‘C列だけ挿入’ Cells.Clear ‘全部消す’ End Sub
View On WordPress
0 notes
unityaiueo-blog · 5 years ago
Text
VBA セルに値を表示
Option Explicit
Sub CellChange() Worksheets(“sheet1”).Range(“A1”).Value = “Hello” ‘sheet1のA1にHelloという値を入れている’ Range(“A2”).Value = “Hello2” ‘アクティブ状態(操作可能)のときは省略可能’ Cells(3, 1).Value = “Hello3” ‘左に行右に列を書いたところに値を挿入’ Cells(3, 1).Offset(1, 0).Value = “Hello4” ‘3,1から行方向に1列方向に0のところに挿入’
End Sub
View On WordPress
0 notes
unityaiueo-blog · 5 years ago
Text
VBA 出力
Option Explicit
Sub Main() ‘プロシージャー名’ MsgBox _ (“Hello World”) ‘MsgBoxで出力 スペースアンダーバーVBE内で改行可能’
End Sub
Sub Main2() ‘二つ目を書くことも可能’ MsgBox (“Hello World2”)
End Sub
View On WordPress
0 notes
unityaiueo-blog · 5 years ago
Text
Java 基本データ型 参照型
参照型はメモリ領域の番地が入る String、配列,Class
基本データ型は値そのものが入る  上記の以外
package ddLesson;
public class Main {
public static void main(String[] args){
int x=10;
int y=x;
y=5;
System.out.print(x);
System.out.print(y);
int[] a={3,5,7};
int[] b=a;//番地を指しているので同じ
b[1]=8;
System.out.print(a[1]);
System.out.print(b[1]);
String s=”hello”;//文字列は基本的に変更不可文字列を割り当てると別の領域に新しくデータを確保す…
View On WordPress
0 notes
unityaiueo-blog · 5 years ago
Text
Java 配列for文
package ddLesson;
public class Main {
public static void main(String[] args){
int[]sales={700,400,500};
for(int i=0;i<sales.length/*lengthで要素数全部を取得*/;i++){
System.out.print(sales[i]);
}
for(int sale:sales){//拡張for文salesをsaleとして取り出している
System.out.println(sale);
}
}
}
View On WordPress
0 notes
unityaiueo-blog · 5 years ago
Text
Java 配列
package ddLesson;
public class Main {
public static void main(String[] args){
//int[]/sales/*宣言
/*sales=new int[3];//データ領域の確保そうする事で以下の3つを使える
sales[0]=100;
sales[1]=200;
sales[2]=300;*/
//int[]sales;宣言
//sales=new int[]{100,200,300};初期化
int[] sales={100,200,300};//一気に書く方法
System.out.println(sales[1]);
sales[1]=1000;
System.out.println(sales[1]);
}
}
View On WordPress
0 notes
unityaiueo-blog · 5 years ago
Text
Java for文
package ddLesson;
public class Main {
public static void main(String[] args){
for(int i=0;i<10;i++){//条件式の間回るiを1ずつ増やす処理
if(i==5){
// break;//iが5の時for文を抜ける処理
continue;//iが5の時次のループ処理に移る
}
System.out.println(i);
}
}
}
View On WordPress
0 notes
unityaiueo-blog · 5 years ago
Text
Java while dowhile文
package ddLesson;
public class Main {
public static void main(String[] args){
int i=0;
while(i<10){//条件式がtrueであるかぎりループする
System.out.println(i);
i++;//1増やしている
}
do{//dowhile文は条件判定が後なので最低でも一回は処理される
System.out.print(i);
i++;
}while(i<10);
}
}
View On WordPress
0 notes