Results 1 to 1 of 1

dynamically linked cells--merging issue

Threaded View

Anthony_Schultz dynamically linked... 04-04-2011, 04:56 PM
  1. #1
    Registered User
    Join Date
    04-03-2011
    Location
    Baltimore, USA
    MS-Off Ver
    Excel 2003
    Posts
    1

    dynamically linked cells--merging issue

    Hi,

    First of all, I know that merged cells are really frowned upon. However, this is one of those cases that cannot be solved with a pivot table (at least, I don't think it can). Here is what I need:

    I am a teacher that uses an excel sheet that my school system gave me. It uses merged cells. I am trying to enhance the sheet so that it saves my colleagues and me time. Basically, I am making a sheet that will automatically create letters home to parents after each test. I've created drop-down menus at the top to change the data dynamically.

    I need to dynamically reference merged cells from another sheet. This wouldn't be a problem, but it is referencing many sheets, and each sheet has a different merge situation. The good news is, it is limited to one row.

    The code that I have isn't nearly where it should be. I ran into a wall when I tried to use a variable inside the merge command. I am very new to this type of stuff; thank you for your patience!

    Here is the code I have so far:


    Option Explicit
    
    Public Sub MergeRow()
    Dim c As Range
    [a1:ac1].UnMerge  '<-Unmerge the cells from the old data.
                        'This will need to go somewhere else, before the new data is referenced.
                       
    Application.DisplayAlerts = False       'Prevent merge warning from popping up
    For Each c In Range("A1:B1")
    
        If c.Offset(0, 1).Value = "" Then
        '[c:c.Offset(0, 1)].Merge   <-not sure what the syntax would be here, but this aint it!
        End If
      
        Next c
       
    End Sub
    I've attached my excel worksheet. My code so far is located in the sheet entitled "Sheet 1."

    Once this problem is fixed, there are a few other issues that I know I will run into--if I cannot fix them, should I post them in this thread, or should I create new threads? I'm guessing the latter, but please let me know which is more acceptable. Thank you so much in advance for your time!
    Attached Files Attached Files
    Last edited by Anthony_Schultz; 04-04-2011 at 05:03 PM.

Thread Information

Users Browsing this Thread

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

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