You are here:

Excel/Auto fill in Macro

Advertisement


Question
Hi Tom

Here is an extract from my spreadsheet, it might make it easier to explain:

I am trying to get the customer name (Azelis, Victrex etc) in column D against every invoice, rather than just being at the top of the section of data in column C.  So far I can get it to do the first section (Azelis), and part of the second section (Victrex)but need the macro to carry on and finish Victres, then do the same for, Dow and Merck.  Any line that dosent have an invoice on it will eventually be deleted. Hope this makes it a bit clearer!

Gail

A          B          C          D
618978          AZELIS UK LTD   
28/06/13   Invoice         PSI_001436   AZELIS UK LTD
Total for AZELIS UK LTD          AZELIS UK LTD
        
650975          VICTREX    
19/06/13   Invoice         PSI_001423   VICTREX          Invoice         PSI_001429   
28/06/13   Invoice         PSI_001432   
25/06/13   Invoice         PSI_001433   
30/06/13   Invoice         PSI_001446   
Total for VICTREX MANUFACTURING         
        
C00005          DOW
15/05/13   Invoice         PSI_001385   
23/05/13   Invoice         PSI_001389   
31/05/13   Invoice         PSI_001411   
06/06/13   Invoice         PSI_001415   
21/06/13   Invoice         PSI_001427   
28/06/13   Invoice         PSI_001441   
Total for DOW          
        
C00012          MERCK KGaA   
13/06/13   Invoice         PSI_001419   
04/07/13   Invoice         PSI_001454   
Total for MERCK KGaA

Answer
Gail,

No way I can tell what data is in what column from your posting.

for example:

618978          AZELIS UK LTD
28/06/13 Invoice      PSI_001436 AZELIS UK LTD
Total for AZELIS UK LTD        AZELIS UK LTD



If in column A you had

618978
28/06/13
Total for Azelis UK LTD

in column A, then my second macro should work


if you had

28/06/13
Total for Azelis UK LTD

in column A and 618978 in another column, then my first macro should work.

If you want to send a sample file you can send it to twogilvy@msn.com

--
Regards,
Tom Ogilvy  
About Excel
This topic answers questions related to Microsoft Excel spreadsheet (or workbook) stand-alone or Mircrosoft Office Excel including Excel 2003, Excel 2007, Office 2000, and Office XP. You can get Excel help on Excel formulas(or functions), Excell macros, charting in Excel, advanced features, and the general use of Excel. This does not provide a general Excel tutorial nor the basics of using a spreadsheet. It provides specific answers to using Microsoft Excel only. If you do not see your Excel question answered in this area then please ask an Excel question here

Excel

All Answers


Answers by Expert:


Ask Experts

Volunteer


Tom Ogilvy

Expertise

Selected as an Excel MVP by Microsoft since 1999. Answering Excel questions in Allexperts since its inception in 2001. Able to answer questions on almost all aspects of Excel's internal capabilities. If seeking a VBA solution, please specify that in your question itself so I give you the answer you want. [Excel has weak protection - if you are distributing an application, I don't answer questions on how to protect your project from your users.]

Experience

Extensive experience.

Education/Credentials
Master of Science (MS) degree Operations Research (ORSA)

Awards and Honors
Microsoft MVP in Excel.

©2016 About.com. All rights reserved.