PDA

View Full Version : Invoice



tofimoon4
06-01-2009, 12:29 AM
Dear sir,with my regards, i have sent this message to another forum but ( no reply ) asking you kindly to help me , please. Dear sir, with best regards,asking you kindly to take a look for the attached file which contains :
1- Main sheet including an invoice form 2- Agents sheet including all details that we have registerd in the invoice 3- Materials sheet including details from main sheet .
My requests are ( with hope they are simple for you ) :
1- Codes to transfer some details from ( invoice) to ( agents , materials) sheets .
2- The details i need to transfer are( coloured by orange) in ( agents , materials) sheets .
3- The invoice details should be clean after transferring data to accept another ones .
4- In the end of invoice i need a code for ( total amount ) in words .
Hopping i shall win your help .
Thanks in advance.

mdmackillop
06-01-2009, 12:37 AM
Please post a link in both sites.

tofimoon4
06-01-2009, 01:08 AM
Dear sir,with my appreciation , can i have more clearness about above order , please.

mdmackillop
06-01-2009, 01:43 AM
Can you post a link to the other site so I determine if anyone posts before I look at this. As a courtesy, you should do the same at the other site.
Have a look at this post (http://vbaexpress.com/forum/showthread.php?t=26951)

tofimoon4
06-01-2009, 01:58 AM
Dear sir, i have sent this order to (http://www.thecodecage.com/forumz/excel-vba-programming/101099-invoice.html on 29/5/2009 and you can see it staying with no reply till now.
Hopping you shall help after this clarification, please.

mdmackillop
06-01-2009, 02:51 AM
As a courtesy, you should do the same at the other site

tofimoon4
06-01-2009, 03:23 AM
Dear sir, am i right when explaining these orders that ( there is no reply ).
Thank you for giving me some time.

MaximS
06-01-2009, 04:59 AM
try that, see attachments for details:

tofimoon4
06-01-2009, 08:01 AM
Dear sir,with my thanks for your interest and solution , like to inform your goodself that:
1- No data transferred from main sheet to anothers by ( update) button.
2- I have recieved this message after ( updating) : ( compile error:variable not defined) .
Hopping you shall study these matters cure.
Thanking you.

MaximS
06-01-2009, 08:45 AM
change misstyped ING to INV.

it won't do anything if invoice form is empty (range c18:g39).

tofimoon4
06-01-2009, 11:22 PM
Dear sir,you are wonderful,you are genius,it works very very nice,thank you very much for help.

mdmackillop
06-02-2009, 12:33 AM
Dim INV, AGN, MAT As Worksheet
Dim dDate As Date
Dim tInv As String
Dim LRow, LRw, i As Long
Hi Maxim,
FYI, only MAT is dimmed as worksheet and only i is dimmed as long, The other items on the row become variants. You should Dim each item separately. Lists don't follow English usage!
Regards
MD

mdmackillop
06-02-2009, 12:47 AM
Hi Tofimoon,
You should now see that Patrick Molloy has wasted his time at The Codecage because you did not publish a link there as requested. ( I have now done so)

With regard to your question here, why do you provide a sample with no data. Do you consider your tiime more valuable than ours?

Repetition of inconsiderate postings will incur suspension from this site.
Regards
MD

tofimoon4
06-02-2009, 02:04 AM
Dear sir,i ask you kindly to accept my apology for this an intended mistake.
Hopping it wont repeat again.

MaximS
06-02-2009, 02:52 AM
mdmackillop I didn,t know that, but thanks for advice.

Can you tell me then if below is correct?

Dim x As Long, y As Long, z As Long, i As Long, j As Long

mdmackillop
06-02-2009, 03:03 AM
Hi Maxim

That is OK

tofimoon4
06-02-2009, 03:30 AM
Dear Mr.MaximS,with my appreciation,1- is there any modification of the code will help the program more 2-is it possible to modify the code by adding column (U) in (materials) sheet which shall contains (agent)name .
Thanks in advance.

MaximS
06-02-2009, 04:12 AM
hi,

1 - tell me what you want to improve and we will think about it
2 - done

see attachment for details.

tofimoon4
06-02-2009, 09:22 AM
Dear sir,many thanks for help,you are excellent realy.

hardlife
06-02-2009, 01:05 PM
http://www.vbaexpress.com/kb/getarticle.php?kb_id=735

Submitted by: alimcpill (http://www.vbaexpress.com/forum/member.php?u=442)

Approved by: mdmackillop (http://www.vbaexpress.com/forum/member.php?u=87)

tofimoon4
06-02-2009, 01:24 PM
Thank you my dear for this link.

tofimoon4
12-16-2009, 08:52 AM
Dear sir,with my regards ,First, I apologize for the tardiness of this observation to show now ( because my friend who i have given him this program like to use it now ),second,i hope you shall help me again to solve this problem.
The problem is : in (main) sheet of the invoice ,if i update the data mentioned in columns (38-39) i got a mistake in (materials ) sheet (out) scheduale ( i mean the invoice accept only (20) units).
I ask you kindly to take a look for this problem and tell me hoe to solve.
Many thanks in advance.

Aussiebear
12-16-2009, 01:46 PM
Please attach your workbook so we can see where you are up to?

tofimoon4
12-16-2009, 11:37 PM
Dear sir,with my thanks for interest,i enclosed herewith the invoice with signs on the columns which caused the problem.
i ask you kindly to modify the code to : accept the two signed columns in material sheet ,or cancel them from the invoice without any effects after updating.
my appreciattion .

tofimoon4
12-18-2009, 07:24 AM
Dear experts,i am so sad to see my thread passed to second sheet without any reply.
I hope you shall take a look with my regards.

tofimoon4
12-21-2009, 01:09 AM
Dear sir,with my apology for the insistence,is this delay in replying means deleting the matter.Please let me know.

tofimoon4
12-23-2009, 11:12 PM
Dir expert,please consider my above request as cancelled to try sending the problem to another forum with my apology.

Aussiebear
12-24-2009, 12:09 AM
I'm sorry to read that you believe that you need to relocate this issue to another forum, however that is your right to do so. I trust that you understand that those people who operate here do so on a voluntary basis. We attend here when we are able to do so, despite the workload our own personal lives have. I wish you well in your endevours

Aussiebear
12-24-2009, 12:37 AM
I had a quick look at your workbook and could see that apart from the code provided by MaximS, you don't seem to have added, amended anything else as an alternative to that which has been currently offered. Even when you were given a link to an section of code in the KB, you haven't tried to add it to your workbook. Perhaps in hindsight you may have been better off getting a professional programmer to assist your issue.

By all means continue the thread here if you wish, but you will need to be patient with your requests.

tofimoon4
12-24-2009, 06:40 AM
Dear sir,with my appreciation,shall i wait or leave please.
I hope (if there is any light in the sight) to have the solution before 28/12 with my regards.

Aussiebear
12-24-2009, 06:20 PM
Have a look here at the following code. It is very similar to that which we have in the KB as was indicated in a post earlier.

tofimoon4
12-25-2009, 06:57 AM
Dear sir,i didnt see any code with your message, please.

Aussiebear
12-25-2009, 03:17 PM
My apologies

Option Explicit

Function SpellNumber(ByVal MyNumber)
Dim Dollars, Cents, Temp
Dim DecimalPlace, Count
ReDim Place(9) As String
Place(2) = " Thousand "
Place(3) = " Million "
Place(4) = " Billion "
Place(5) = " Trillion "
' String representation of amount.
MyNumber = Trim(Str(MyNumber))
' Position of decimal place 0 if none.
DecimalPlace = InStr(MyNumber, ".")
' Convert cents and set MyNumber to dollar amount.
If DecimalPlace > 0 Then
Cents = GetTens(Left(Mid(MyNumber, DecimalPlace + 1) & "00", 2))
MyNumber = Trim(Left(MyNumber, DecimalPlace - 1))
End If
Count = 1
Do While MyNumber <> ""
Temp = GetHundreds(Right(MyNumber, 3))
If Temp <> "" Then Dollars = Temp & Place(Count) & Dollars
If Len(MyNumber) > 3 Then
MyNumber = Left(MyNumber, Len(MyNumber) - 3)
Else
MyNumber = ""
End If
Count = Count + 1
Loop
Select Case Dollars
Case ""
Dollars = "No Dollars"
Case "One"
Dollars = "One Dollar"
Case Else
Dollars = Dollars & " Dollars"
End Select
Select Case Cents
Case ""
Cents = " and No Cents"
Case "One"
Cents = " and One Cent"
Case Else
Cents = " and " & Cents & " Cents"
End Select
SpellNumber = Dollars & Cents
End Function



This code is untested, so open a new workbook, type Alt F11 to go to the VBE, click Insert Module and copy this code into the module. Save then return to Sheet1, in cell A1 input a number, then in any other cell type =Spellnumber(A1)

tofimoon4
12-26-2009, 12:16 PM
Dear sir,with my appreciation to your interest,my problem is not in this code,the problem is in ( main ) sheet columns (38,39)when i register the data in ,and transfer them by clicking the update button ,the trouble will appear in (materials) sheet . i mean some modify in the code will solve
thanking you

mdmackillop
12-28-2009, 05:43 AM
I regret that I cannot assist at the moment as I have limited PC access and no Excel. I suggest you isolate your problem and post it as a new question. That is likely to get a quicker response

tofimoon4
12-28-2009, 10:37 PM
Ok sir and many thanks