Skip to content

Instantly share code, notes, and snippets.

@wmydz1
Created November 22, 2017 05:12
Show Gist options
  • Select an option

  • Save wmydz1/c65ab1da208e373fa50366f1359ece2d to your computer and use it in GitHub Desktop.

Select an option

Save wmydz1/c65ab1da208e373fa50366f1359ece2d to your computer and use it in GitHub Desktop.
打开用户提供的excel数据,鼠标定位到第一行数据的最后一个单元格(这里是F2单元格),
输入="",在双引号里面写入INSERT语句脚本,这里举例oracle语句的insert into语句,格式如
INSERT INTO USER(USER_CODE,USER_NAME,USER_TYPE,IS_ENABLED,IN_DATE)VALUES('"&&"','"&&"','"&&"','"&&"',TO_DATE('"&&"','YYYY-MM-DD'));
首先选中需要批量输入公式的所有单元格,然后按下F2编辑,输入完第一个公式后,按下CTRL+回车键结束。
按【Ctrl+Enter】组合键可同时填充相同数据。
  需要注意公式中的单元格引用关系。Excel中有三种引用关系(绝对引用符号$),分别是:相对引用、绝对引用、混合引用。根据实际情况来选择。
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment