• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

"Macro Loop" SoS

Misa bobby

New Member
Bills.PNG Invoice Form.PNG Good Morning,

I am trying to copy paste value from one sheet(Bill) to the other sheet (Invoice Form).
  • Everytime I receive different type of Invoices. So i want computer to recognize what type of Invoice and paste to the right place.
  • Each Bill will come different time, and each bill has to prepare its own Invoice Form. There fore I want computer to recognize where to copy the right Value
Here are the sheets that I made up as an example. Thank you guys.. I appreciate your help.
 
Last edited:
Rather than some pictures of a workbook where everything is on one sheet, could you provide an actual example workbook showing your layout? To write a macro, we need to know exactly where things are located.
 
Thank you Luke. But each type of bill ( Consulting Fees, Investment fees, Legal Fees...) must be prepared its invoice individually. For example. if i want to prepare an invoice for Administration fees . i will prepare its invoice individually just like what i did for legal Fees
 
I basically want to use one invoice form. Whenever there is a new bill coming in click the button that says " Copy" to copy the value that corresponding to same name..
 
So, the Invoice form is a template? Are you wanting the macro to create multiple sheets/books for each bill? Or just click one at a time?

Seems like some SUMIFs, VLOOKUPs, or some other similar type formula would be much easier for such a small data transfer.
 
Yes It is a template. every time it transfers values to the form. I will save as into a specific folder., then erase the data.
 
they are not in the same sheet, but i use only one template.. and then
"Save as" then erase all the data from the template,, if i want to make an "administration fees" invoice, i will go to template again to make invoice , then save as . clear original content you see my point?
 
Rather than clearing the content, if you save your Invoice form as a template (.xltx), then you can open the file and make changes w/o affecting the original. I would suggest going this way to start. For the Bills, so it seems that there are only 1 (maybe 2...) values that get copied from the Bills to the Invoice. If this is true, we could add in a macro to the template (making it a .xltm file then, since it would have a macro) to transfer the values.

Needless to say, the code that I already wrote should serve as an example of what you need. you'll need to figure out what exact process you want to do in transferring these files. I'm still not sure whether you want a macro to loop through multiple files of bills and create an invoice for each one, or for the macro to just transfer 2 values, or if there's other values. :(
 
"I'm still not sure whether you want a macro to loop through multiple files of bills and create an invoice for each one" thats right! Luke.
 
Getting into some more complicated macros, but this should get you started.
 

Attachments

  • Invoice Form.xlsm
    22.1 KB · Views: 10
Back
Top