在特定时间将单元格输入添加到其他单元格 [英] adding the cell inputs to other cell at specific time

查看:116
本文介绍了在特定时间将单元格输入添加到其他单元格的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

美好的一天,


亲爱的先生/小姐,


好的,我需要您的支持,知道如何在同一张表中将称为(每日库存输入)的每日输入单元添加到其他称为(总余额)的单元格中。在特定时间示例(上午12:00),在库存总余额中添加数字,并在新工作日开始时清算单元格(每日库存输入)


提前致谢


祝愿

解决方案

你好


希望您能正确理解所有事情。如果您有任何疑问或进一步的问题,请告诉我。


问候


Deepak


good day,

dear Sir/Miss,

kindly ,I need your kind supporting to know how to adding the daily inputs of cell called (daily stock inputs) to other cells called (total balance) in same sheet. at specific time example(at 12:00 am) ,adding number to total balance of stock,and clearing the cell (daily stock inputs).at the beginning of new work day.

thanks in advance

Best regards

解决方案

Hi Dheyaa Raheem,

please follow the example below.

I have 2 cells with name Dailystock and Totalstock.

code:

Private Sub Workbook_Open()
Application.OnTime TimeValue("00:00:00"), "demo2"
MsgBox ("done")
End Sub
Sub demo2()
Dim cell, cell1 As Range
Set cell = Worksheets("Sheet1").Range("Dailystock")
Set cell1 = Worksheets("Sheet1").Range("Totalstock")
cell1.Value = cell1.Value + cell.Value
cell.Value = ""
End Sub

Output:

it will call the sub demo2 at 12 AM.

here I use Workbook_open event to call demo2 sub.

so when you open the workbook it will execute and after that at 12 AM demo2 sub will execute.

if your workbook remain open all the time  or your workbook remain close then Workbook_open event will not call next day by itself.

it will only call only 1 time when you open the workbook.

so in that condition you need to use Task Scheduler to call the macro.

if you open the workbook everyday by yourself then there is no issues.

but you need to be sure that it stays open at 12 AM. because at this time demo2 will execute.

Reference:

Application.OnTime Method (Excel)

Hope you understand all the things correctly. if you have any doubt or further question then let me know about that.

Regards

Deepak


这篇关于在特定时间将单元格输入添加到其他单元格的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆