简体   繁体   中英

In Excel macro how to assign negative sign when copy paste function

在Excel宏中复制粘贴功能时如何分配负号,复制粘贴功能时如何为借方列分配负号

Although I think a formula would be the way forward in your case:

="-"&A1 (Change A1 to cell you refer to)

Here is a piece of code for you to work on

Range("A2").Value = "-" & Range("A1").Value

And In case you are pasting values from outside Excel, then add the "-" to the cell after the paste..

Range("A2").value = "-" & Range("A2").value

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM