I have a simple question regarding setting the value a cell in excel using vba.
The following code doesn't work, could anyone help me with it?
Thisworkbook.sheets("name1").range("I"& 4 +k).value = ActiveSheet.Range("D" & k)
Thank you!
ThisWorkbook.Sheets("name1").Range("I" & (4 +k)).Value = ActiveSheet.Range("D" & k).Value
How's that? The brackets around (4 + k)
will help the calculation, and the .Value
at the end will allow the value to be taken across.
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.