简体   繁体   中英

How to combine multiple cells value (dynamic) in one specific cell in excel via VBA macro?

I am working in a consent as account assistant. I need to generate the outstanding report every month. Below is my master data sheet where I am regularly updating client invoice, amount , date of invoice and payment status

主表

Every month end I need to prepare outstanding report as below (sheet name Outstanding that sheet contain two column, clients and another one pending_date_amount). Manually I'm entering all pending invoice date and amount and total pending amount next cell to relevant Client name cells. This process takes more time. If anyone suggests how to simplify this process and avoid manual process, formula or VBA (I have very little bit knowledge in VBA) please help on this and my work pressure will get reduced.

报告表

You can create a function that loops over all customers in the Mainsheet. If the payment status is pending, write it to an additional worksheet. This is not that hard. I would suggest you to get basic knowledge in excel vba. You can use this or anything else. There are a lot of resources on the web. Just to give you an idea here is a sample pseudo code:

Dim lRowCountMain as Long
Dim lRowCountReport as Long
lRowCountMain = 1
lRowCountReport = 1

do
    If Table1.Range("D" & lRowCountMain).Value = "Pending" Then
        'Write your needed information
        Table2.Range("A" & lRowCountReport).Value = "Some Information"
        lRowCountReport = lRowCountReport +1
    End If
lRowCountMain = lRowCountMain +1
Loop Until lRowCountMain = 5000 Or Table1.Range("A" & lRowCountMain).text = ""

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM