Hello,
Can someone help me creating a vba program, to increment the cell value by 1 from a value in the external file. The value of both cells should be increased from a click of the button.
Thank you so much in advance.
Hello,
Can someone help me creating a vba program, to increment the cell value by 1 from a value in the external file. The value of both cells should be increased from a click of the button.
Thank you so much in advance.
Hi, welcome to the frum.
Just create a simple file with one sheet and a starting value in cell A1 (this value will be the next value to use)
Save this file with something like RefNr.xlsx
All you need to do now is open the workbook you're working with.
write a macro hat open the regnr.xlsx file store the value in A1 to a variable
Un the value in A1 + 1 and save and close the regnrs file
The variable will have the next number
---
Hans
"IT" Always crosses your path!
May the (vba) code be with you... if it isn't; start debugging!
If you like my answer, Click the * below to say thank-you
Hi Keballah,
Thank you for the response. But I require from a single click, the value in two excel differnet worksheets should be incremented. I would be great you could provide some sample program. Since I am just a beginner in vba.
It's a single click once you have the macros.
So if you're really that a beginner what do you want to do, ask for every little modification?
I do not know where the value is to be stored in the worksheet, you mention TWO oka, I think you mean one that holds the next value and the one where you required this upped-value?
There are basically two files. The one that contains the value (for example: excel file- source.xls, A1= 10), and the other file where the value should be stored (eg: target.xls , to be stored in range A1 as 11).
So from a click of a macro button., the value should be incremented in source.xls and the 'incremented value' should be stored in the target.xls file.
Thank you
Yes, you understood perfectly.
Did you create the file? Did you record the macro?
Now just link the macro to a button.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks