<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>appendRow</title>
	<atom:link href="https://office-automation-lab.com/tag/appendrow/feed/" rel="self" type="application/rss+xml" />
	<link>https://office-automation-lab.com</link>
	<description>AIとExcelで仕事を少しだけ楽にする方法を、リアルな体験と検証で発信</description>
	<lastBuildDate>Sat, 13 Jun 2026 15:47:09 +0000</lastBuildDate>
	<language>ja</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=7.0</generator>

<image>
	<url>https://office-automation-lab.com/wp-content/uploads/2026/06/cropped-サイト画像-32x32.jpg</url>
	<title>appendRow</title>
	<link>https://office-automation-lab.com</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>GASでフォーム入力データを別シートへ転記するコード｜案件管理を自動化する方法</title>
		<link>https://office-automation-lab.com/gas-form-transfer-database/</link>
					<comments>https://office-automation-lab.com/gas-form-transfer-database/#respond</comments>
		
		<dc:creator><![CDATA[mkhome_ai]]></dc:creator>
		<pubDate>Sat, 13 Jun 2026 14:50:22 +0000</pubDate>
				<category><![CDATA[GASコード集]]></category>
		<category><![CDATA[appendRow]]></category>
		<category><![CDATA[GAS]]></category>
		<category><![CDATA[GoogleAppsScript]]></category>
		<category><![CDATA[スプレッドシート]]></category>
		<category><![CDATA[データ転記]]></category>
		<category><![CDATA[案件管理]]></category>
		<category><![CDATA[業務効率化]]></category>
		<guid isPermaLink="false">https://office-automation-lab.com/?p=587</guid>

					<description><![CDATA[・入力フォームから案件データベースへ登録できる・案件IDを自動で採番できる・ボタンを押すだけで利用可能 このコードでできること ・入力フォームの内容を別シートへ転記・案件IDを自動採番・案件データを蓄積 GASコード シ [&#8230;]]]></description>
										<content:encoded><![CDATA[
<p class="wp-block-paragraph">・入力フォームから案件データベースへ登録できる<br>・案件IDを自動で採番できる<br>・ボタンを押すだけで利用可能</p>



<h2 class="wp-block-heading">このコードでできること</h2>



<p class="wp-block-paragraph">・入力フォームの内容を別シートへ転記<br>・案件IDを自動採番<br>・案件データを蓄積</p>



<h2 class="wp-block-heading">GASコード</h2>



<p class="wp-block-paragraph"></p>



<pre class="wp-block-code"><code>function saveProject() {

  const ss = SpreadsheetApp.getActiveSpreadsheet();

  const formSheet = ss.getSheetByName("案件入力フォーム");
  const dbSheet = ss.getSheetByName("案件データベース");

  // 次の案件IDを生成（A00001形式）
  const lastRow = dbSheet.getLastRow();
  const nextNumber = lastRow;

  const caseId =
    "A" +
    String(nextNumber).padStart(5, "0");

  // フォームの値取得
  const projectName = formSheet.getRange("C2").getValue();
  const clientName = formSheet.getRange("C3").getValue();
  const person = formSheet.getRange("C4").getValue();

  const orderDate = Utilities.formatDate(
    new Date(formSheet.getRange("C5").getValue()),
    Session.getScriptTimeZone(),
    "yyyy/MM/dd"
  );

  const amount = formSheet.getRange("C6").getValue();
  const status = formSheet.getRange("C7").getValue();
  const memo = formSheet.getRange("C8").getValue();

  // 登録日
  const today = Utilities.formatDate(
    new Date(),
    Session.getScriptTimeZone(),
    "yyyy/MM/dd"
  );

  // データベースへ追加
  dbSheet.appendRow(&#91;
    today,
    caseId,
    projectName,
    clientName,
    person,
    orderDate,
    amount,
    status,
    memo
  ]);

  SpreadsheetApp.getUi().alert(
    "案件を登録しました。" 
  );

}</code></pre>



<h2 class="wp-block-heading">シート構成</h2>



<h3 class="wp-block-heading">案件入力フォーム</h3>



<figure class="wp-block-table"><table class="has-fixed-layout"><thead><tr><th>セル</th><th>項目</th></tr></thead><tbody><tr><td>C2</td><td>案件名</td></tr><tr><td>C3</td><td>顧客名</td></tr><tr><td>C4</td><td>担当者</td></tr><tr><td>C5</td><td>受注日</td></tr><tr><td>C6</td><td>金額</td></tr><tr><td>C7</td><td>ステータス</td></tr><tr><td>C8</td><td>備考</td></tr></tbody></table></figure>



<p class="wp-block-paragraph">入力例</p>



<figure class="wp-block-table"><table class="has-fixed-layout"><thead><tr><th>項目</th><th>値</th></tr></thead><tbody><tr><td>案件名</td><td>HP制作</td></tr><tr><td>顧客名</td><td>株式会社ABC</td></tr><tr><td>担当者</td><td>山田</td></tr><tr><td>受注日</td><td>2026/06/14</td></tr><tr><td>金額</td><td>500000</td></tr><tr><td>ステータス</td><td>進行中</td></tr><tr><td>備考</td><td>トップページ修正あり</td></tr></tbody></table></figure>



<p class="wp-block-paragraph">図形ボタンを配置し、以下の関数を割り当てます。</p>



<pre class="wp-block-code"><code>関数名：saveProject</code></pre>



<p class="wp-block-paragraph">▶ <a target="_blank" href="https://office-automation-lab.com/gas-button-run/" data-type="link" data-id="https://office-automation-lab.com/gas-button-run/">実行ボタンの作成方法</a></p>



<h3 class="wp-block-heading">案件データベース</h3>



<figure class="wp-block-table"><table class="has-fixed-layout"><thead><tr><th>A</th><th>B</th><th>C</th><th>D</th><th>E</th><th>F</th><th>G</th><th>H</th><th>I</th></tr></thead><tbody><tr><td>登録日時</td><td>案件ID</td><td>案件名</td><td>顧客名</td><td>担当者</td><td>受注日</td><td>金額</td><td>ステータス</td><td>備考</td></tr></tbody></table></figure>



<h2 class="wp-block-heading">カスタマイズ例</h2>



<h3 class="wp-block-heading">パターン①</h3>



<p class="wp-block-paragraph">登録後に入力フォームをクリアする</p>



<p class="wp-block-paragraph">追加コード</p>



<pre class="wp-block-code"><code>formSheet.getRange("B3:B9").clearContent();</code></pre>



<h3 class="wp-block-heading">パターン②</h3>



<p class="wp-block-paragraph">案件IDを5桁にする</p>



<p class="wp-block-paragraph">修正コード</p>



<pre class="wp-block-code"><code>const projectId = formSheet.getRange("B2").getValue();</code></pre>



<h2 class="wp-block-heading">よくあるエラー</h2>



<h3 class="wp-block-heading">ボタンを押しても実行されない</h3>



<p class="wp-block-paragraph">対処法</p>



<p class="wp-block-paragraph">・関数名がregisterDataになっているか確認<br>・ボタンに関数を割り当てているか確認<br>▶ <a target="_blank" href="https://office-automation-lab.com/gas-button-run/" data-type="link" data-id="https://office-automation-lab.com/gas-button-run/">実行ボタンの作成方法</a></p>



<h3 class="wp-block-heading">シートが見つからない</h3>



<p class="wp-block-paragraph">対処法</p>



<p class="wp-block-paragraph">・案件入力フォームのシート名を確認<br>・案件データベースのシート名を確認</p>



<h2 class="wp-block-heading">サンプルファイル</h2>



<p class="wp-block-paragraph">このコードを試せるGoogleスプレッドシートを配布しています。</p>



<p class="wp-block-paragraph">▶ サンプルシートをコピーする</p>



<p class="wp-block-paragraph">ファイル名</p>



<pre class="wp-block-code"><code><a rel="noopener" target="_blank" href="https://docs.google.com/spreadsheets/d/1z_BWNh2ctMQbiYbV0DjQdiHqWjc8WJsz9knZ38aS07M/edit?usp=sharing" data-type="link" data-id="https://docs.google.com/spreadsheets/d/1z_BWNh2ctMQbiYbV0DjQdiHqWjc8WJsz9knZ38aS07M/edit?usp=sharing">案件管理システム_1（GASコードなし）</a>

<a rel="noopener" target="_blank" href="https://docs.google.com/spreadsheets/d/1uBahwWsJ73AXaNtCar5MpeRYwK0pzSVYQL4OfSxVm3k/edit?usp=sharing" data-type="link" data-id="https://docs.google.com/spreadsheets/d/1uBahwWsJ73AXaNtCar5MpeRYwK0pzSVYQL4OfSxVm3k/edit?usp=sharing">【完成】案件管理システム_1（GASコードあり）</a></code></pre>



<h2 class="wp-block-heading">関連記事</h2>



<p class="wp-block-paragraph">▶ GASで入力フォームを自動クリアするコード</p>



<p class="wp-block-paragraph">▶ GASでチェックボックスにチェックしたら別シートへ転記するコード</p>



<p class="wp-block-paragraph">▶ GASで担当者別にデータを集計するコード</p>
]]></content:encoded>
					
					<wfw:commentRss>https://office-automation-lab.com/gas-form-transfer-database/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
