View Full Version : [SOLVED:] Incrementing value in a cell depending on clicking of a macro button
Decatron
07-04-2023, 10:01 PM
Hi
I want a cell "b9" to get incremented by 1 automatically whenever the macro "SaveFile" is being clicked. Please help me by suggesting an appropriate code snippet for the above query
Thanks!
georgiboy
07-04-2023, 10:19 PM
Welcome to the forum,
Maybe add the below line to your SaveFile macro:
Range("B9") = Range("B9") +1
Or
Sheet1.Range("B9") = Sheet1.Range("B9") + 1
Or
Sheets("Sheet1").Range("B9") = Sheets("Sheet1").Range("B9") + 1
Decatron
07-04-2023, 11:19 PM
Welcome to the forum,
Maybe add the below line to your SaveFile macro:
Range("B9") = Range("B9") +1
Or
Sheet1.Range("B9") = Sheet1.Range("B9") + 1
Or
Sheets("Sheet1").Range("B9") = Sheets("Sheet1").Range("B9") + 1
Decatron
07-04-2023, 11:20 PM
Thanks for the help. It worked.
Powered by vBulletin® Version 4.2.5 Copyright © 2025 vBulletin Solutions Inc. All rights reserved.