cells

Auto updating a date in a cell when another cell is edited - Google Sheets

主宰稳场 提交于 2020-02-06 09:33:14
问题 I have looked at various scripts etc. on this site which should solve my query but none of them seem to work. Basically I have a Google Sheet where members can update a figure in column F. They should also change the edit date in column G but invariably forget that, so I am looking to automate it. I am a complete novice when it comes to writing scripts etc but, as I have said, none of those I have tried have worked. Any suggestions? 回答1: I tried this one earlier and it didn't work but I have

Auto updating a date in a cell when another cell is edited - Google Sheets

蓝咒 提交于 2020-02-06 09:29:29
问题 I have looked at various scripts etc. on this site which should solve my query but none of them seem to work. Basically I have a Google Sheet where members can update a figure in column F. They should also change the edit date in column G but invariably forget that, so I am looking to automate it. I am a complete novice when it comes to writing scripts etc but, as I have said, none of those I have tried have worked. Any suggestions? 回答1: I tried this one earlier and it didn't work but I have

C# Excel导出(使用EPPlus)

一笑奈何 提交于 2020-01-30 21:27:36
using (ExcelPackage package = new ExcelPackage(new FileInfo(@"C:\test.xlsx"))) { ExcelWorksheet worksheet = package.Workbook.Worksheets.Add("test");//创建worksheet worksheet.Name = "交通"; // worksheet.Cells[1, 1].Value = "名称";//直接指定行列数进行赋值 worksheet.Cells["A1"].Value = TableName;//直接指定单元格进行赋值 worksheet.Cells[1, 1].Style.HorizontalAlignment = ExcelHorizontalAlignment.Center;//水平居中 worksheet.Cells[1, 1, 1, dt.Columns.Count].Merge = true;//合并单元格 worksheet.Cells["A2"].Value = "报表时间:" + det.ToString("yyyy年MM月dd日");//直接指定单元格进行赋值 worksheet.Cells[2, 1].Style.HorizontalAlignment = ExcelHorizontalAlignment

HTML游戏之贪吃蛇

荒凉一梦 提交于 2020-01-29 08:48:43
HTML游戏之贪吃蛇Snake,代码来自github作者 Steven Lambert < ! DOCTYPE html > < html > < head > < title > < / title > < style > html , body { height : 100 % ; margin : 0 ; } body { background : black ; display : flex ; align - items : center ; justify - content : center ; } canvas { border : 1 px solid white ; } < / style > < / head > < body > < canvas width = "400" height = "400" id = "game" > < / canvas > < script > var canvas = document . getElementById ( 'game' ) ; var context = canvas . getContext ( '2d' ) ; var grid = 16 ; var count = 0 ; var snake = { x : 160 , y : 160 , // snake velocity. moves one

全民一起VBA基础篇第三课:变量与常量

試著忘記壹切 提交于 2020-01-24 10:58:28
变量 Sub 加法变量() i = Cells(2, 2) Cells(i, 9) = Cells(i, 5) + Cells(i, 7) '利用变量来控制 End Sub 计算半径,面积和体积 Sub 求面积和体积() Radius = Cells(4, 3) r = Radius Square = 4 * r * r * 3 Cells(4, 4) = Square volume = 4 / 3 * r * r * r * 3 Cells(4, 5) = volume '大小写不敏感 End Sub 常量 Option Explicit '强制申明,变量只能用一次 Sub 求面积和体积() Dim Radius, r, square, volume Const pi = 3.14 '申明常量,不允许变动 Radius = Cells(4, 3) r = Radius square = 4 * r * r * pi Cells(4, 4) = square volume = 4 / 3 * r * r * r * pi Cells(4, 5) = volume '大小写不敏感 End Sub 来源: CSDN 作者: 高开低走。 链接: https://blog.csdn.net/qq_43568982/article/details/103738118

全民一起VBA基础篇第五课:字符串,逻辑运算,调试

故事扮演 提交于 2020-01-16 05:45:46
调试 设置断点 单击语句左侧,得到一个红色的点 单步调试 按F8进入调试 添加监视 调试->添加监视 调试完后去掉所有断点 调试->清除所有断点 字符串 与或非的表示是 And Or Not 注意区分 没有括号,先not, and 后or if age<30 and field = “数学” or field=“物理” then 左右两边都要完整 if cells(1,1)=“RMB” Or cells(1,1)=“人民币” then if not age >16 then 两个字符串之间的连接 用 & 符号左右需要各空出一格 录制宏 例如,需要知道高亮和加粗是怎样的 可以如下操作 开发工具->录制宏 选中任一单元格,加粗,改色 停止录制 Sub 宏3() With Selection.Font .Color = -16776961 .TintAndShade = 0 End With Selection.Font.Bold = True End Sub 然后得到上述,进行修改 可以得到下面的代码 Option Explicit Sub highlight() Dim i As Integer For i = 101 To 1 Step -1 '逆序判断比较科学 If Cells(i, 2) > 500 Then '判断单元格的数值 Cells(i, 2).Font.Bold =

全民一起VBA基础篇第十课:工作簿、单元格

一笑奈何 提交于 2020-01-16 02:05:33
打开不同的EXCEL文件并汇总 Option Explicit Sub 季度汇总() Dim i, j, k, fileName, wkPath Dim w As Worksheet, r As Worksheet, wb As Workbook '首先,让 r 代表当前工作簿(“季报.xlsm”)的汇总表 Set r = ActiveWorkbook.Worksheets("季度汇总") 'ActiveWorkbook.Path属性可以返回本工作簿所在的文件夹, '因此当其他待处理工作簿跟本工作簿在同一文件夹下时,可以用Path找到它们。 wkPath = ActiveWorkbook.Path '循环生成每个月的文件名,并打开相应工作簿 For i = 4 To 6 fileName = i & "月.xlsx" '标记文件名,这个例子中的名字都比较规律 Set wb = Workbooks.Open(wkPath & "\" & fileName) '让 w 指向该月文件的第一张工作表(即月报表) Set w = wb.Worksheets(1) '循环扫描该工作表的第3-10行,依次加到汇总表的同一行 For k = 3 To 10 For j = 3 To 6 '以下四行代码可以用循环的方式改写,更加方便 r.Cells(k, j) = r.Cells(k, j) + w

GridView中合并单元格

一曲冷凌霜 提交于 2020-01-07 22:10:16
#region 合并单元格 合并某一行的所有列 public static void GroupRow(GridView gridView) { for (int rowIndex = gridView.Rows.Count - 2; rowIndex >= 0; rowIndex--) { GridViewRow row = gridView.Rows[rowIndex]; GridViewRow previousRow = gridView.Rows[rowIndex + 1]; for (int i = 0; i < row.Cells.Count; i++) { if (row.Cells[i].Text == previousRow.Cells[i].Text) { row.Cells[i].RowSpan = previousRow.Cells[i].RowSpan < 2 ? 2 : previousRow.Cells[i].RowSpan + 1; previousRow.Cells[i].Visible = false; } } } } ///  <summary>  ///  合并GridView中某行相同信息的行(单元格) ///  </summary>  ///  <param  name="GridView1">GridView对象</param>  //

If value will change, change few cells color

自闭症网瘾萝莉.ら 提交于 2020-01-07 06:41:18
问题 i can't find answer for my issue, maybe you can helf me to solve this problem. I want to change this VBA Script to have something like: if in column A value will change - run VBA Script for example, if in cell A2 or A3, or A4 and so on = 1, (cells B2, C2, E2, H2) will green and (D2, F2, G2 and J2) will rot. if A2 or A3 ...... = 2 (B2, C2,) will green, D2, F2 will rot if A3 value will change, than change B3, C3 if A4 will change, change B4, C4 and so on Values in column A user will change "by

How do I export a single record from Access to specific cells in Excel

家住魔仙堡 提交于 2020-01-07 04:34:24
问题 I am trying to export the record displayed on a form in Access to an Excel template which I would then rename and use the data in further calculations. I want to click a button on the form to transfer the record to Excel, I rename it and be done. The data fields will need to go to specific cells in the spreadsheet. Each record represents a seasoning formula with fields as such: Formula_name Formula_number Date_entered Ingredient1 Amount1 Ingredient2 Amount2 Ingredient3 And so on The amounts