计算机丢失formsUM,Excel如何制作自动SUM表单(Excel how to make auto SUM form)

Excel如何制作自动SUM表单(Excel how to make auto SUM form)

我想,然后我在单元格中输入一个数字(值)它自动求和(或点击“输入”或点击按钮后更好),结果显示在另一个单元格中。 之后,单元格变空,我可以在同一单元格中输入下一个值。 例如。 我有两个单元格A2和B2 。 在第一个,我总是输入数据,在第二个 - 显示总数。 因此,如果我们进入单元格B2 ,结果为“230”。 然后我按下ENTER或某个按钮后进入单元格A2 100, B2的结果变为“330”,之后的A2变为空。 而这个我可以按照自己的意愿做很多次。

请帮我解释一下代码。 提前致谢。

I want, then I enter a number (value) in the cell it auto sum(or it's better after clicking "enter" or clicking the button), and the result display in another cell. After that the cell became empty and I can enter next value in the same cell. For example. I have two cells A2 and B2. In the first, I always enter data, in the second - shows totals. So if we got in cell B2 the result "230". then I enter in the cell A2 100 after press ENTER or some button the result in B2 become "330" and A2 after that become empty. And this I can do so many time as I want.

Please help me with the code. Thanks in advance.

原文:https://stackoverflow.com/questions/41283142

2019-11-04 19:11

满意答案

您需要一个在单元格值更改时触发的宏。 在工作表更改事件上触发以下代码,然后检查更改的单元格是否为A2而不是空。 如果是,则将A2的值添加到B2的当前值,并将A2设置为null。

Private Sub Worksheet_Change(ByVal Target As Range)

Dim KeyCells As Range

Set KeyCells = Range("A2")

If Not Application.Intersect(KeyCells, Range(Target.Address)) Is Nothing _

And Range("A2") <> "" Then

Range("B2").Value = Range("B2").Value + Range("A2").Value

Range("A2").Value = ""

Range("A2").Select

End If

End Sub

将此作为宏添加到当前工作表中,然后您输入A2任何数字都将添加到当前值B2 。

这只是快速示例代码,因此您可能需要进行修改以满足您的特定需求。 我会研究验证条目是数字而不是文本。

You'll need a macro that triggers when a cell value changes. The following code is triggered on a worksheet change event and then checks if the cell changed is A2 and not empty. If so then add the value of A2 to the current value of B2 and set A2 back to null.

Private Sub Worksheet_Change(ByVal Target As Range)

Dim KeyCells As Range

Set KeyCells = Range("A2")

If Not Application.Intersect(KeyCells, Range(Target.Address)) Is Nothing _

And Range("A2") <> "" Then

Range("B2").Value = Range("B2").Value + Range("A2").Value

Range("A2").Value = ""

Range("A2").Select

End If

End Sub

Add this as a macro to your current worksheet and then any numbers you enter into A2 will be added to the current value of B2.

This is just quick example code so you will likely need to modify to suit your specific need. I would research validating entries are numbers and not text also.

相关问答

尝试使用UDF CellIsNotHidden 。 这将处理1d(矢量)和2d数组。 测试: Function CellIsNotHidden(MyRange As Range) As Variant

Dim RootCell As Range

Dim tmpResult() As Long

Dim i As Long

Dim j As Long

On Error GoTo Whoops

ReDim tmpResult(0 To MyRange.Rows.Count - 1,...

我并不难。 观察输入内的键事件,当前输入是最后一个输入时添加一个新输入(例如使用$.after() ) 演示: http : //jsfiddle.net/doktormolle/WaL84/ I'ts not difficult. Observe a key-event inside the input and when the current input is the last input add a new input(e.g. using $.after()) Demo: http://j...

您想使用回调接口。 有各种各样的回调暴露,例如: require "mongoid"

require "pp"

Mongoid.configure.connect_to("test")

class Model

include Mongoid::Document

field :price1, type: Integer

field :price2, type: Integer

field :price3, type: Integer

store_in collection...

假设您的数据从A1开始请在B1发布以下公式,并在column B填写column A数据 =TRIM(SUBSTITUTE(MID(A1,(SEARCH("dTM_c1_",A1,1)+7),99),CHAR(34),REPT(CHAR(32),99)))

您将获得uid7,uid8等可以计算或其他处理可以完成。 编辑根据您的评论并采用"dTM_c1_uidnn.."字符串出现次数显示在以下快照中。 我已经展示了两个快照,其中一个隐藏了辅助列。 这是我现在能做的最好的事情。 可以使用Exce...

您可以使用范围相对公式属性.FormulaR1C1来使公式引用相对调整: .Cells(iRow, 1).FormulaR1C1 = .Cells(iRow - 1, 1).FormulaR1C1

您也可以使用常规.Formula属性,如果您想要完全相同的公式,而不更新相对引用。 您也可以同时对所有4列执行此操作: .Cells(iRow, 1).Resize(, 4).FormulaR1C1 = .Cells(iRow - 1, 1).Resize(, 4).FormulaR1C1

You ...

我假设您不需要显示PLACING是否为0.(即从上一个问题开始,将0表示“此行中没有任何内容”...那么您应该能够做到: =if(r9=0,0,(SUM(D9:N9)-LARGE(D9:N9,1)-LARGE(D9:N9,2)-SMALL(D9:N9,1)-SMALL(D9:N9,2)))

I assume you don't need to display if the PLACING is 0. (ie from the previous question, placing 0 means ...

对! 使用Application.visible = False然后重置它。 把它放在你的用户形态中 Private Sub UserForm_Initialize()

Application.Visible = False

End Sub

'

'~~> Rest of the code

'

Private Sub UserForm_QueryClose(Cancel As Integer, CloseMode As Integer)

ThisWorkbook.Close Sa...

尽管在B2中输入简单公式=SUM(A$2:A2)并将其复制下来可能很诱人,但如果要对大范围进行求和,与公式=SUM(B1,A2) 为什么? 假设您复制=SUM(A$2:A2)向下10行。 第2行的结果只需要加1个数字:A2中的数字。 您在第3行的结果必须总计2个数字:A2:A3中的数字。 您在第4行的结果必须总计3个数字:A2:A4中的数字。 ... 您在第11行的结果必须总计10个数字:A2:A11中的数字。 那么Excel必须添加多少个数才能产生你在B2:B11中计算出的答案? 1 + 2 +...

答:A是相对参考,将在您移动公式时更新。 你只需要将它改为绝对值,比如$ A:$ A: =SUMIF('Daily Expense'!$A:$A,CONCATENATE("2/",B1,"/2017"),'Daily Expense'!$B:$B)

现在,当您自动填充时,它将仅更新B1参考。 A:A is a relative reference which will update as you move the formula. You just need to change it to ab...

您需要一个在单元格值更改时触发的宏。 在工作表更改事件上触发以下代码,然后检查更改的单元格是否为A2而不是空。 如果是,则将A2的值添加到B2的当前值,并将A2设置为null。 Private Sub Worksheet_Change(ByVal Target As Range)

Dim KeyCells As Range

Set KeyCells = Range("A2")

If Not Application.Intersect(KeyCells, Range(Ta...

相关文章

在很多情况下,我们并不想自己主动触发COMMIT相应的XML给SOLR,这样带来很多的不便,恰好,SO

...

JXLS根据excel模板生成EXCEL并下载,jxl.jar,jxls-core-0.9.9.jar

...

内容摘要:HTML5 智能form表单新属性,主要包括智能表单介绍和智能表单使用与规范。但在不同支持H

...

baseinfoForm.form.load({ url: '/Url/Institution/In

...

http://puretech.paawak.com/2009/04/29/how-to-make-c

...

当前我的页面是用一个<c:forEach >遍历出来的。有多个form每个都不一样,我可以

...

前言:今天在项目中看到有小模块是上传Excel解释后保存到数据库的操作,好奇之下去了解了如何使用Apa

...

当hibernate设置采用JDBC事务,事务上下文设置为thread的时候,将transaction

...

如题,怎么给form的一个hidden隐藏域中传个id进去 问题补充:不能存在那里面

...

最新问答

找到了完全相同的东西: http : //www.dragonbyte-tech.com/product/40-vbcredits-ii-deluxe/ Found something that does exact same thing: http://www.dragonbyte-tech.com/product/40-vbcredits-ii-deluxe/

不知道任何可以实际切换的调试器,但您可以将两个调试器连接到您的进程。 在调试模式下在Java IDE中启动Java程序会附加Java调试器。 然后打开用于CPP代码的IDE,并将其调试器附加到正在运行的Java进程。 在Visual Studio中,这将是Debug -> Attach to Process... 您将看到一个包含进程列表的对话框。 在这里选择您的Java进程。 如果Visual Studio无法正确检测到,您可能必须将列表上方的字段切换为“本机代码”。 在CPP代码中设置适当的

您需要使用ajax发送该变量。 $.get('your.jsp', {data: $('#'+this.id+'t').val()}, function(response) { console.log(response); }); You need to send that variable using ajax. $.get('your.jsp', {data: $('#'+this.id+'t').val()}, function(response) { console.l

确保已设置root密码(sudo su passwd)根据ssh的安装方式,通常需要编辑/ etc / ssh / sshd_config并将“PermitRootLogin no”更改为“PermitRootLogin yes” Make sure you have set a root password (sudo su passwd) Depending how your ssh is installed, you usually need to edit /etc/ssh/sshd_co

看看FMDB的用法 。 [db executeUpdate:@"INSERT INTO notes VALUES (?,?,?)", title, comment, [NSNumber numberWithInt:fkID]]; 提供给-executeUpdate:方法的所有参数(或接受va_list作为参数的任何变体)都必须是对象。 Here is what I ended up doing. NSString *sql = [NSString stringWithFormat:

我后来发现这是一个与多德兴相关的问题。 我需要运行一个脚本来为我的main-dex-list生成文件的名称 下面的博客文章详细介绍了这一点: http : //blog.osom.info/2014/10/generating-main-dex-list-file.html I later found out that this was an issue relating to multi dexing. I needed to run a script to generate the name

使用OAuth 2.0,您可以使用可扩展的标准和基于令牌的身份验证,使用户可以撤消身份验证票证,例如,如果他们的手机被盗。 OAuth 2.0支持各种授权类型。 那些来自facebook和twitter登录的人可以概括为“3-legged oauth”,但是对于2-legged OAuth,还有两种授权类型,特别是资源所有者密码凭证授权 (页面末尾的第4.3节),这将是只需交换身份验证令牌的用户名和密码即可。 如果你不愿意,就没有必要实施三条腿的oauth。 对于大多数用例,我建议在基于加密的自

您应该将此作为多个连接进行处理。 特别是,您需要为电子邮件的“从”和“到”部分单独加入: SELECT e.EmailID as id, e.DateStamp as timed, edfrom.profileid as sender, edto.profileid as receiver FROM EmailDirection edfrom join Email e on edfrom.emailid = e.emailid and ed.direction

问题根本不是ngZone 。 事实上,您正在使用更改this值的常规函数。 所以this.distance内的this.distance距离function(response,status)是不同的。 尝试: (response, status)=> { if (status === 'OK') { directionsDisplay.setDirections(response); var total = 0; var rou

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值