is there any way of coding to do this?
for example we have :
A1.value = 5
A1.Formula = 2*3 ' ...... entering a formula into the same cell A1
A1.Value = 11 ? '...... at the end it becomes 11
thanks a lot..
is there any way of coding to do this?
for example we have :
A1.value = 5
A1.Formula = 2*3 ' ...... entering a formula into the same cell A1
A1.Value = 11 ? '...... at the end it becomes 11
thanks a lot..
Is the value (5) in A1 being entered manually, or does it come from somewhere else, like another cell or sheet?
1N73LL1G3NC3 15 7H3 4B1L17Y 70 4D4P7 70 CH4NG3 - 573PH3N H4WK1NG
You don't have to add Rep if I have helped you out (but it would be nice), but please mark the thread as SOLVED if your issue is resolved.
Tom
Manually .. Or.. it is already calculated by a simple formula (say =0.05*100)
thanks..
If its entered manually into the cell, in this case, A1, you cannot have a formula in that cell, it will give a "Circular Reference" error as you cannot (at least I don't think you can) have a formula in a cell that references itself. If it is entered with the formula that you show in your last post, change your formula to
Please Login or Register to view this content.
You posted this in the VBA section so I'm assuming you may be looking for something like this.
Right click on the tab for the sheet you want the code to run on and click view code. Paste the code below into the code window.
The code uses cell A1 as an example. If the for example the value in cell A1 starts at zero, if I type 10 into cell A1 the value will change to 10. If I now type = 10 * 2, then the value changes to 30, but there is no formula left in the cell. So the code stores the previous value and adds the results of what you type into cell A1 to that previous value.
If you want to get the value in cell A1 back to zero then type negative whatever the amount in the cell is.
For instance the cell now say 30, so I type -30 into the cell hit enter and I have restored the cell to zero.
EDIT:
I added some more code at the bottom. Follow the instructions for adding that code.
After you enter the code above you should see the project explorer window. You will see ThisWorkbook in that window. Right click on ThisWorkbook, choose view code and paste the code below into that window.Please Login or Register to view this content.
If you don't see ThisWorkbook then go to the menus at the top choose View and Project Explorer or as a shortcut you could just press Control + r
In the code where you see "Sheet1" type the name of your sheet with the quotes. So if your sheet is named Data, then change "Sheet1" to "Data" in the code.
Save the workbook as a .xlsm macro enabled workbook.
Please Login or Register to view this content.
Last edited by skywriter; 05-31-2015 at 02:12 PM.
Click the * Add Reputation button in the lower left hand corner of this post to say thanks.
Don't forget to mark this thread SOLVED by going to the "Thread Tools" drop down list above your first post and choosing solved.
This should do
To a sheet code module
Please Login or Register to view this content.
My bad, I didn't pay attention to the fact (obviously)that this post was in the VBA/Macro section.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks