+ Reply to Thread
Results 1 to 2 of 2

How to code repeating vba formatting/cell merging

  1. #1
    Registered User
    Join Date
    09-27-2013
    Location
    Idaho
    MS-Off Ver
    Excel 2007
    Posts
    1

    How to code repeating vba formatting/cell merging

    Please Login or Register  to view this content.
    'This code module creates a summary sheet for weekly deliveries to various welfare agencies around our valley. We make an
    'excel delivery sheet
    'for each agency as we deliver to them, and I'm trying to summarize our weekly deliveries from those sheets for inventory control and etc..
    'The delivery sheets consist, first, of the agency name info followed by item quanities and descriptions. There are 12 or fewer items
    'per sheet. The delivery sheet info is concatenated into four columns on the summary sheet. The agency info requires more space so needs
    'to go into merged cells. So then the agency info is in the merged cells followed by the item quanities and their descriptions'

    HERE IS MY PROB. - the code in the next line properly merges cells a1:d1 which holds the agency name for the first delivery
    'sheet processed but I need to change it/something to format/merge the cells used for subsequent agency names as their sheets are
    'processed. The deliveries are not all the same length so can't just format every nth row. Some agencies order more stuff than others.
    'The variable h1 is a counter placed on the "sumry" sheet which points to the last used row, so I add one to point to the next row available.
    'I'll strive for more coding elegance after I get this $*@%#& thing working. I now open each delivery sheet file manually. I'll next try to
    'step through the folder and open and process each file automatically. Typically about a dozen delivery files per week.


    Please Login or Register  to view this content.
    Thank you, thank you for any suggestions.
    Last edited by alansidman; 11-07-2013 at 11:15 AM. Reason: code tags added

  2. #2
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2405 Win 11 Home 64 Bit
    Posts
    23,895

    Re: How to code repeating vba formatting/cell merging

    Your post does not comply with Rule 3 of our Forum RULES. Use code tags around code.

    Posting code between [CODE]Please [url=https://www.excelforum.com/login.php]Login or Register [/url] to view this content.[/CODE] tags makes your code much easier to read and copy for testing, it also maintains VBA formatting.

    Highlight your code and click the # icon at the top of your post window. More information about these and other tags can be found here



    (I have added them for you this time. In the future, please read the forum rules and abide by them.)
    Alan עַם יִשְׂרָאֵל חַי


    Change an Ugly Report with Power Query
    Database Normalization
    Complete Guide to Power Query
    Man's Mind Stretched to New Dimensions Never Returns to Its Original Form

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Repeating code
    By Bob316 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 02-24-2010, 03:00 AM
  2. Help with repeating the code
    By rusoo7 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-23-2009, 07:05 AM
  3. Repeating code
    By Myrmecophaga in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-31-2008, 06:57 AM
  4. Merging code - Validation and Formatting
    By Sirishgreen in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 11-20-2007, 07:22 AM
  5. Repeating code
    By mandeepuppal in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-18-2006, 06:50 AM

Tags for this Thread

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