需要帮助来完成VBA [英] Need help with completing a VBA

查看:97
本文介绍了需要帮助来完成VBA的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,


     我目前正在使用此公式每分钟显示数据:



Private Sub Worksheet_change(ByVal Target作为范围)

   如果Target.Address =" $ A $ 1"然后

     使用ThisWorkbook.Names(" listdde")。RefersToRange.CurrentRegion

         使用.Offset(.Rows.Count,0).Resize(1,1)

              .Value =现在

              .Offset(0,1).Value = Target.Value

         结束与

     结束与

   结束如果

End Sub





 如何让这个宏在24小时后返回初始单元格(B2)( b1441),所以它循环?



 除此之外,我希望将其作为一个单元格填充我希望它前面的第五个单元格被清除,否则会影响我的其他公式。


例如当b2给出一个读数时,B7是然后擦了擦。 B3给出了读数,B8被擦掉了。此外,当B1437给出读数时,B2将被擦除。



非常感谢帮助


谢谢

解决方案

也发布在
https:// answers。 microsoft.com/en-us/msoffice/forum/msoffice_excel-msoffice_custom-mso_2016/help-with-additional-info-for-vba/f2b64064-dbe5-4074-b050-7589e62085e6

Hi,

     I am currently using this formula for showing data every minute:

Private Sub Worksheet_change(ByVal Target As Range)
   If Target.Address = "$A$1" Then
      With ThisWorkbook.Names("listdde").RefersToRange.CurrentRegion
         With .Offset(.Rows.Count, 0).Resize(1, 1)
             .Value = Now
             .Offset(0, 1).Value = Target.Value
          End With
      End With
   End If
End Sub

 How do I get this macro to return to the initial cell (B2) when it reaches 24 hours (b1441), so it loops?

 On top of that I would like that as a cell is filled I would like that the fifth cell in front of it is cleared, as this would otherwise affect my other formulas.

For example when b2 gives a reading, B7 is then wiped. B3 gives a reading, B8 is wiped. Also when B1437 gives a reading then B2 would be wiped.

Help would be very much appreciated

Thanks

解决方案

Also posted in https://answers.microsoft.com/en-us/msoffice/forum/msoffice_excel-msoffice_custom-mso_2016/help-with-additional-info-for-vba/f2b64064-dbe5-4074-b050-7589e62085e6


这篇关于需要帮助来完成VBA的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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