Results 1 to 2 of 2

Excel VBA: Merge and Center Cells Based on Date Values in Row Below

Threaded View

  1. #1
    Registered User
    Join Date
    07-15-2013
    Location
    Arizona
    MS-Off Ver
    Excel 2016
    Posts
    64

    Excel VBA: Merge and Center Cells Based on Date Values in Row Below

    Hi all,

    I'm using the following code (found here: http://="http://stackoverflow.com/qu...n-user-input"]) populate dates in row 13 for a dynamic Gantt Chart...

    Sub Date_Fill()
        Dim projEndDate As Date
        Dim projStartDate As Date
        Dim projDuration As Integer
        projStartDate = Range("C9").Value
        projEndDate = Range("C10").Value
        
        With Worksheets("ProjectTacticalGanttChart")
            Set SourceRange = .Range("I13")
            SourceRange.Value = projStartDate
            Set fillRange = .Range(SourceRange, Cells(SourceRange.Row, SourceRange.Column + projEndDate - projStartDate))
            SourceRange.AutoFill Destination:=fillRange, Type:=xlFillDays
        End With
    End Subto
    It works perfectly to display daily dates in the mm/dd format. Now I want to have an overarching month/year displayed over the entire range for any particular month by merging and centering the cells above the month's dates the above code populates, and pull in the month/year formatted as mmm-yyyy. I've attached a mock up I did manually to help convey the desired result.

    Any help is appreciated as always. Please let me know if you have any questions or need clarification.

    Thanks so much!
    Chris
    Attached Images Attached Images

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Merge and Center all cells within a border
    By rfaris in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 09-06-2013, 06:15 PM
  2. Allow Merge and Center in Formatted Cells
    By Mneubert in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-18-2013, 03:45 PM
  3. Merge and Center Multiple Cells with the same data with a button click
    By caliskier in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 10-31-2012, 06:01 PM
  4. Merge Cells based on an adjacent row of values
    By Metal Head in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-04-2011, 09:55 AM
  5. merge and center cells using macro
    By iscar_marius in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 07-13-2009, 03:42 PM

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