簡體   English   中英

雙擊將單元格值復制到另一個單元格

[英]Copy cell value to another cell on double-click

我需要Excel中的VBA代碼。 如果我在E-或-F-或-G列中雙擊一個單元格,則顯示值應復制到相應的H單元格中。 請告知,我是新用戶。

       E       F       G      H
1   1.00    0.50    0.00     
2   1.00    0.50    0.00     
3   1.00    0.50    0.00    

未經測試:

Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)

if Target.Column>=5 and Target.Column<=7 then
 Cells(Target.Row,8)=Target.Value
endif

End Sub

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM