I want to the textbox to post a formula in a cell
lets say (G6=E6-F6+G5) but each time I post the textbox to the next row , the formula will change to be to the next value (G7=E7-F7+G6)
Any Idea ???![]()
I want to the textbox to post a formula in a cell
lets say (G6=E6-F6+G5) but each time I post the textbox to the next row , the formula will change to be to the next value (G7=E7-F7+G6)
Any Idea ???![]()
Last edited by Shacker; 04-28-2013 at 01:53 AM.
Iin accordance with forum rules, please rename your thread to something more meaningful, that actually describes your problem.
Because thread titles are used in searching the forum it is vital they be written to accurately describe your thread content or overall objective using ONLY search friendly key words. That is, your title used as search terms would return relevant results.
Many members will look at a thread title, and if it is of interest to them, or it falls within their area of expertise, they might only open those threads.
Look at it this way...if you typed that title into google, what would you expect to get back?
To change a Title on your post, click EDIT on you're 1st post, then Go Advanced and change your title
1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
2. If your question is resolved, mark it SOLVED using the thread tools
3. Click on the star if you think someone helped you
Regards
Ford
Done
hope its ok now (Y)
The easiest, to me anyway, would seem to be to write the formula into the cell (using relative references), then simply copy/paste drag/fill down. http://office.microsoft.com/en-us/ex...979.aspx?CTT=1
Since this is in the VBA forum, I'm guessing that is not what you want. To write a formula to a cell/range, you can use the formula property of the range object. http://msdn.microsoft.com/en-us/libr...ice.10%29.aspx The formula property is a text string, so changes like you are describing would require you to use VBA's text functions/operators (the concatenate operator & in particular) to build the text string, then write it to the formula property.
Easier would be to use R1C1 notation, http://msdn.microsoft.com/en-us/libr...ice.10%29.aspx because the text string for a formula in R1C1 notation doesn't change. See "reference styles" here http://office.microsoft.com/en-us/ex...997.aspx?CTT=1 for a description of how R1C1 references work.
Originally Posted by shg
Just copy the formula down.
If there's no formula to copy down it should be quite easya to figure out the row references to use.
If posting code please use code tags, see here.
that is correct , but I am using the code that sends the data from the userform to the last line . if I copied the cells down , the data will not be sent to the last used line correctly ...
I need that coz I am using the search in the sheet that will pulls the row with the last column as balance
All-Transaction Sheet
-----column A -----|-----column B -----|-----column C ------|-----column D-----|-----column E-----|
Description | Date | Credit Amount | Debit Amount | Balance |
Invoice # 50 | 04/22/2013 | | 1500.00 | 1500.00 |
Payment # 2 | 04/22/2013 | 1000.00 | | 500.00 |
if I used the copy and past formula in the sheet , I cant send my userform data to the correct fir empty line
if when I use the search code , I get this report without the value in Column E
I believe that , when sending the userform data to the All-Transaction Sheet I must include the formula in the sendtext option ...
Any Other Suggestions ?
this is the code I'm using now
![]()
Please Login or Register to view this content.
Last edited by Shacker; 04-28-2013 at 10:49 AM.
Now we begin to see some of the complexities in your problem.
Since I never use userforms, I'll have to take your word for it that something about using the userform prevents you from copying/pasting a formula down. Since I never use userforms, I don't know if I'll be able to be any real help.if I used the copy and past formula in the sheet , I cant send my userform data to the correct fir empty line
Sometimes when I do this, I "pre-copy" the formula down, then the formula is already in place as data is filled in. I do realize that this creates a column of 0's (0-0+0=0), but the person I program spreadsheets for does not care if there is a column of 0's. He knows that the formula will compute as data is filled in. I recognize that many users cannot stand to see a column of 0's before the data are entered.
I found this code , but don't know how to figure it out to do my needs !!!
![]()
Please Login or Register to view this content.
Sorry you've really lost me.
There's nothing stopping you putting the values from the textboxes in the right cells and copying the formula down.
Also, there's nothing stopping you doing the calculation in code rather than using a formula.
By the way, that last code would be only work if you had a named range called 'Database', do you?
yes Sir, the sheet I am working on as a test called "Database"
balance error.jpg
at the same time I am working at a similar sheet called "AllTrans" ...
when copying the formula in the sheet as per attached image its not giving the correct balance
plz check
Pictures aren't that helpful with this sort of thing, though this one does now tell me you are using a ListView.
One thought I had was that you should perhaps separate things a bit.
Rather than trying to do everything at the same time work on one part, posting data to 'InvoiceClac'.
Then and once that's working fine work on the next part, posting data to 'AllReceipts'.
The code has no problem in posting to any sheet or cell ...
all are working fine .. except the list view sum !!!!
you were right , let the sheet make the calculation
thank you
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks