+ Reply to Thread
Results 1 to 10 of 10

Account Payable

  1. #1
    Registered User
    Join Date
    02-02-2013
    Location
    montreal
    MS-Off Ver
    Excel 2010
    Posts
    12

    Account Payable

    i am new in excel and i need help thanks.
    create account payable with monthly new sheet(automatically will create the sheet)
    problem is i like to add value of some cells in account balance the lines you see has problem .
    i include the file and some pictures and nots i would be happy any one could help me thanks hassan


    '=================================================
    'enter date to account balance


    Dim Xpay As Currency
    Dim XPayNow As Currency
    Dim XDelay As Currency
    Dim XBankFee As Currency
    Dim Xname As String
    Dim Xfuc As String



    Xname = strname
    Worksheets(Xname).Select
    '==========================================================================
    'problem, i need help first of each mounth when new sheet of the mounth
    'create it for account payable i need to entre on line in table3 of account balnce
    'sheet under monthly account payable.
    'this line is very importand
    '1-by looking at this table i know which line has problem and i go to that month to fix it
    '2-i know how much check i give and not been cash
    '3- if there is problem with the date of check i will fix it
    '4- i use it to balance my bank account and my cash money
    '5- after 5 or more years by looking at this page i know where is the problem.
    '===========================
    'give data to each variable
    '****problem, problem
    '--------------------------------------
    'Xpay = Range("J7") 'does not update but it record the new value any time
    'XPayNow = Range("K7") ' you run the marco
    'XDelay = Range("L7")
    'XBankFee = Range("L15")
    '--------------------------------------------
    ' Xpay = "=SUM('2013_01'!J7)" 'or XPay = "=(SUM(J7)" not good
    'XPayNow = "=SUM('2013_01'!K7)"
    'XDelay = "=SUM('2013_01'!L7)"
    ' XBankFee = "=SUM('2013_01'!L15)"
    '-------------------------------------------------------
    'Xpay = Range("J7").Value ' it work but when the amount in j7 change
    ' it does not change in balance sheet on column b
    'row blong to that page
    '---------------------------------------------------------



    '==================================
    '==========================================================================

    Worksheets("Account Balance").Select
    Worksheets("Account Balance").Range("A5").Select



    If Worksheets("Account Balance").Range("A5").Value <> "" Then
    ActiveCell.Offset(1, 0).Select
    Do Until ActiveCell.Value = ""
    ActiveCell.Offset(1, 0).Select
    Worksheets("Account Balance").Range("A5").End(X1Down).Select
    Loop
    Worksheets("Account Balance").Range("A5").End(X1Down).Select
    End If


    ActiveCell.Value = Xname
    ActiveCell.Offset(0, 1).Select
    ActiveCell.Value = Xfuc
    ActiveCell.Offset(0, 1).Select
    ActiveCell.Value = XPayNow
    ActiveCell.Offset(0, 1).Select
    ActiveCell.Value = XDelay
    ActiveCell.Offset(0, 1).Select
    ActiveCell.Value = XBankFee


    Worksheets(Xname).Select


    excel1.jpgExcel2.jpg
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    05-30-2012
    Location
    The Netherlands
    MS-Off Ver
    Office 365
    Posts
    14,987

    Re: Account Payable

    With an pivot table.

    See the attached file.

    Before i made an pivot table, i used a macro to get all data to the sheet consolidated.
    Attached Files Attached Files
    Notice my main language is not English.

    I appreciate it, if you reply on my solution.

    If you are satisfied with the solution, please mark the question solved.

    You can add reputation by clicking on the star * add reputation.

  3. #3
    Registered User
    Join Date
    02-02-2013
    Location
    montreal
    MS-Off Ver
    Excel 2010
    Posts
    12

    Re: Account Payable

    thanks but give me lots of information which i do not need and i need one row and 5 column for each month in one table .
    1- sheet name (create every month, name the same as month and year)
    2- pay ( the value in J7)
    3- Pay Now ( the value in K7)
    4- Delay (the value in L7)
    5- Bank fee (the value in L15)

    may be your slotion is answer but i could not understand to modfy the code to get what i want .
    please take look at the project one more time. thanks

  4. #4
    Forum Expert
    Join Date
    05-30-2012
    Location
    The Netherlands
    MS-Off Ver
    Office 365
    Posts
    14,987

    Re: Account Payable

    In that case you better add the desired (expected) result in your file.

  5. #5
    Registered User
    Join Date
    02-02-2013
    Location
    montreal
    MS-Off Ver
    Excel 2010
    Posts
    12

    Re: Account Payable

    thanks i am working on that it is not easy for me but i am trying to make it.
    thanks for replay and i will use the pivot table for retrieving data of individual company for duration of months or years. and the code you give me it is complete and perfect thanks again.

  6. #6
    Registered User
    Join Date
    02-02-2013
    Location
    montreal
    MS-Off Ver
    Excel 2010
    Posts
    12

    Re: Account Payable

    i find how to insert the value of total in account payable to account balance. even when total change in account payable automatically update in account balance

    Worksheets("Account Balance").Select
    Worksheets("Account Balance").Range("A5").Select



    If Worksheets("Account Balance").Range("A5").Value <> "" Then
    ActiveCell.Offset(1, 0).Select
    Do Until ActiveCell.Value = ""
    ActiveCell.Offset(1, 0).Select
    If ActiveCell.Value = Xnme Then 'not to enter dublicate value from each page
    Exit Sub
    End If

    Worksheets("Account Balance").Range("A5").End(X1Down).Select
    Loop
    Worksheets("Account Balance").Range("A5").End(X1Down).Select
    End If



    ActiveCell.Value = Xname
    ActiveCell.Offset(0, 1).Select

    ActiveCell.Formula = "=SUMIF(_2013_02[Status],'2013_02'!J$6,_2013_02[Amount])" **works but when you do not use variable
    '(sheet name[column name],'sheet name '!cell ,Sheet name[column name])
    ActiveCell.Offset(0, 1).Select
    ActiveCell.Formula = "=SUMIF(_2013_02[Status],'2013_02'!K$6,_2013_02[Amount])" **works but when you do not use variable
    '(sheet name[column name],'sheet name '!cell ,Sheet name[column name])
    ActiveCell.Offset(0, 1).Select
    ActiveCell.Formula = "=SUMIF(_2013_02[Status],'2013_02'!L$6,_2013_02[Amount])" **works but when you do not use variable
    '(sheet name[column name],'sheet name '!cell ,Sheet name[column name])
    ActiveCell.Offset(0, 1).Select
    ActiveCell.value= Worksheets(Xname).Range("L15")



    because i use the formula which located in account payable in cell j7,k7.l7 and i want this formula insert in all new account payable automatically when the sheet name change use variable(Xname) to insert formula in j7,k7,l7 of new page which create every month.
    has problem of calling the worksheet name, column name and using """" or &"" or ! and all reference codes
    i copy from others but i do not know what is it. but i know what i want i don't know how to write it in excel vba language

    example



    ActiveCell.Offset(0, 1).Select
    ActiveCell.Formula = "=SUMIF(""&Xname&""[Status],'Xname'!J$6,""&Xname&""[Amount])" ' problem with ""' &"" !"' and ........

    ActiveCell.Formula = "=SUMIF(_2013_02[Status],'2013_02'!J$6,_2013_02[Amount])" **works but when you do not use variable
    '(sheet name[column name],'sheet name '!cell ,Sheet name[column name])
    thanks

  7. #7
    Registered User
    Join Date
    02-02-2013
    Location
    montreal
    MS-Off Ver
    Excel 2010
    Posts
    12

    Re: Account Payable

    i find how to insert the value of total in account payable to account balance. even when total change in account payable automatically update in account balance

    Worksheets("Account Balance").Select
    Worksheets("Account Balance").Range("A5").Select



    If Worksheets("Account Balance").Range("A5").Value <> "" Then
    ActiveCell.Offset(1, 0).Select
    Do Until ActiveCell.Value = ""
    ActiveCell.Offset(1, 0).Select
    If ActiveCell.Value = Xnme Then 'not to enter dublicate value from each page
    Exit Sub
    End If

    Worksheets("Account Balance").Range("A5").End(X1Down).Select
    Loop
    Worksheets("Account Balance").Range("A5").End(X1Down).Select
    End If



    ActiveCell.Value = Xname
    ActiveCell.Offset(0, 1).Select

    ActiveCell.Formula = "=SUMIF(_2013_02[Status],'2013_02'!J$6,_2013_02[Amount])" **works but when you do not use variable
    '(sheet name[column name],'sheet name '!cell ,Sheet name[column name])
    ActiveCell.Offset(0, 1).Select
    ActiveCell.Formula = "=SUMIF(_2013_02[Status],'2013_02'!K$6,_2013_02[Amount])" **works but when you do not use variable
    '(sheet name[column name],'sheet name '!cell ,Sheet name[column name])
    ActiveCell.Offset(0, 1).Select
    ActiveCell.Formula = "=SUMIF(_2013_02[Status],'2013_02'!L$6,_2013_02[Amount])" **works but when you do not use variable
    '(sheet name[column name],'sheet name '!cell ,Sheet name[column name])
    ActiveCell.Offset(0, 1).Select
    ActiveCell.value= Worksheets(Xname).Range("L15")



    because i use the formula which located in account payable in cell j7,k7.l7 and i want this formula insert in all new account payable automatically when the sheet name change use variable(Xname) to insert formula in j7,k7,l7 of new page which create every month.
    has problem of calling the worksheet name, column name and using """" or &"" or ! and all reference codes
    i copy from others but i do not know what is it. but i know what i want i don't know how to write it in excel vba language

    example



    ActiveCell.Offset(0, 1).Select
    ActiveCell.Formula = "=SUMIF(""&Xname&""[Status],'Xname'!J$6,""&Xname&""[Amount])" ' problem with ""' &"" !"' and ........

    ActiveCell.Formula = "=SUMIF(_2013_02[Status],'2013_02'!J$6,_2013_02[Amount])" **works but when you do not use variable
    '(sheet name[column name],'sheet name '!cell ,Sheet name[column name])
    thanks

  8. #8
    Forum Expert
    Join Date
    05-30-2012
    Location
    The Netherlands
    MS-Off Ver
    Office 365
    Posts
    14,987

    Re: Account Payable

    I don't understand your question.

    What is what you like to know.

    Tip: put your code beween tags (#)

  9. #9
    Registered User
    Join Date
    02-02-2013
    Location
    montreal
    MS-Off Ver
    Excel 2010
    Posts
    12

    Re: Account Payable

    correct the red part and in green part is what i want and blue part is work without variable and the variable id Xname as string for current or active worksheet name


    ActiveCell.Formula = "=SUMIF(""&Xname&""[Status],'Xname'!J$6,""&Xname&""[Amount])"


    ActiveCell.Formula = "=SUMIF(sheet name[column name],'sheet name '!cell ,Sheet name[column name])

    ActiveCell.Formula = "=SUMIF(_2013_02[Status],'2013_02'!J$6,_2013_02[Amount])" **works but when you do not use variable
    '(sheet name[column name],'sheet name '!cell ,Sheet name[column name])

  10. #10
    Forum Moderator jeffreybrown's Avatar
    Join Date
    02-19-2009
    Location
    Cibolo, TX
    MS-Off Ver
    Office 365
    Posts
    10,316

    Re: Account Payable

    @hassan1960,

    Administrative Note:
    • We would love to continue to help you with your query, but first, before we can proceed…
    • Please see Forum Rule #3 about code tags and adjust accordingly...
    HTH
    Regards, Jeff

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1