The attached sheet is used to inventory lottery tickets. The ticket number is scanned with a barcode reader and the info placed on an input line. Several other details are added then the line is "Added to inventory" with the macro button. The macro clears the input line so the next item can be entered. I can't clear the values without dumping the formulas in the calculating cells, which wouldn't be an issue but the cells won't recalculate the new input.
I need to be able to clear the cell values (but leave the formulas) and need to kick the sheet to recalc the input row. Ideas?
Last edited by itsunclebill; 03-21-2010 at 07:23 PM.
Not sure what you mean, the code clears the cells,but leaves the formulas in the input line
Hope that helps.
RoyUK
--------
If you are pleased with a member's answer then use the Star icon to rate it, if you are pleased enough to part with cash consider a donation to Children in Need
For Excel consulting, free examples and tutorials visit Excel Consulting-Excel VBA
Check out the free Excel Toolbar
New members please read & follow the Forum Rules
Remember to mark your questions Solved and rate the answer(s)
Code Tags: Make your code easier for us to read
The macro runs thisas part of the process. It's the only way I know to clear the cells with values in them. The code leaves formulas but also leaves the previously calc'd value. The line doesn't want to recalculate so I have to manually force the calculations to happen and don't understand why.Code:For Each cell In Range("rgnINV") If Not cell.HasFormula Then cell.ClearContents Next cell
Hit the "add to Inventory" key and see what happens
Your example has Calculation set to Manual, see the Formulas Tab
Hope that helps.
RoyUK
--------
If you are pleased with a member's answer then use the Star icon to rate it, if you are pleased enough to part with cash consider a donation to Children in Need
For Excel consulting, free examples and tutorials visit Excel Consulting-Excel VBA
Check out the free Excel Toolbar
New members please read & follow the Forum Rules
Remember to mark your questions Solved and rate the answer(s)
Code Tags: Make your code easier for us to read
Didn't know THAT was even in there.Thanks.
If you are satisfied with the solution(s) provided, please mark your thread as Solved.
How to mark a thread Solved
Go to the first post
Click edit
Click Go Advanced
Just below the word Title you will see a dropdown with the word No prefix.
Change to Solved
Click Save
Hope that helps.
RoyUK
--------
If you are pleased with a member's answer then use the Star icon to rate it, if you are pleased enough to part with cash consider a donation to Children in Need
For Excel consulting, free examples and tutorials visit Excel Consulting-Excel VBA
Check out the free Excel Toolbar
New members please read & follow the Forum Rules
Remember to mark your questions Solved and rate the answer(s)
Code Tags: Make your code easier for us to read
This will be quicker than your loop for non formula cells
Also,why the macro Sheet?Code:On Error Resume Next Range("rgnINV").SpecialCells(xlCellTypeConstants).ClearContents On Error GoTo 0
Hope that helps.
RoyUK
--------
If you are pleased with a member's answer then use the Star icon to rate it, if you are pleased enough to part with cash consider a donation to Children in Need
For Excel consulting, free examples and tutorials visit Excel Consulting-Excel VBA
Check out the free Excel Toolbar
New members please read & follow the Forum Rules
Remember to mark your questions Solved and rate the answer(s)
Code Tags: Make your code easier for us to read
Thanks for the clearcontents.
Macro sheet is junk left over from another project and is just there and handy for the data valadation list. The project is VERY early alnog at this point and I haven't done my housecleaning yet.
Macro sheets are from Excel 95 I believe & totally unnecessary for later versions, use an ordinary worksheet
Hope that helps.
RoyUK
--------
If you are pleased with a member's answer then use the Star icon to rate it, if you are pleased enough to part with cash consider a donation to Children in Need
For Excel consulting, free examples and tutorials visit Excel Consulting-Excel VBA
Check out the free Excel Toolbar
New members please read & follow the Forum Rules
Remember to mark your questions Solved and rate the answer(s)
Code Tags: Make your code easier for us to read
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks