+ Reply to Thread
Results 1 to 9 of 9

Copying Titles Down

  1. #1
    Registered User
    Join Date
    10-24-2012
    Location
    Cleveland, OH
    MS-Off Ver
    Excel 2010
    Posts
    44

    Copying Titles Down

    Hello Everyone,

    I think that this should be a simple macro to create, but I'm not sure how to do it. I want my titles to copy down until it reachs a cell with text. When it reaches a cell with text, I want that text to copy down until it reaches the next cell with text.

    I think that the example I have attached should clarify what I am looking for. Anyone know how to create a macro to do this?
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    12-24-2007
    Location
    Alsace - France
    MS-Off Ver
    MS 365 Office Suite
    Posts
    5,066

    Re: Copying Titles Down

    Try next code and adjust A5 to the beginning of the range to treat or detail where to start

    Please Login or Register  to view this content.
    Last edited by PCI; 11-13-2013 at 12:37 PM. Reason: Typo

  3. #3
    Forum Contributor
    Join Date
    09-23-2008
    Location
    Mexico
    Posts
    200

    Re: Copying Titles Down

    Option:
    Please Login or Register  to view this content.

  4. #4
    Forum Expert Solus Rankin's Avatar
    Join Date
    05-24-2013
    Location
    Hollywood, CA
    MS-Off Ver
    Win7 Office 2010 VS Express 2012
    Posts
    2,655

    Re: Copying Titles Down

    Another option
    Please Login or Register  to view this content.
    Thanks,
    Solus


    Please remember the following:

    1. Use [code] code tags [/code]. It keeps posts clean, easy-to-read, and maintains VBA formatting.
    Highlight the code in your post and press the # button in the toolbar.
    2. Show appreciation to those who have helped you by clicking below their posts.
    3. If you are happy with a solution to your problem, mark the thread as [SOLVED] using the tools at the top.

    "Slow is smooth, smooth is fast."

  5. #5
    Registered User
    Join Date
    10-24-2012
    Location
    Cleveland, OH
    MS-Off Ver
    Excel 2010
    Posts
    44

    Re: Copying Titles Down

    Thanks for the answers everyone. The first one worked great! Now I would like to use it for the next column over as well, but when I try to run the macro I get a duplication error. I think that I must be missing something to change in the code.

    The code that I used twice was as follows, the parts in green is was I changed. Can you please tell me what else I need to change in the code?

    Dim WkRg As Range
    Dim LastRow As Long
    Dim F As Range
    Application.ScreenUpdating = False
    On Error Resume Next
    LastRow = Range("B" & Rows.Count).End(xlUp).Row
    Set WkRg = Range([A5], Range("A" & LastRow))
    WkRg.SpecialCells(xlCellTypeConstants, 21).ClearContents
    For Each F In WkRg.SpecialCells(xlCellTypeBlanks)
    F.Value = F.Offset(-1, 0)
    Next
    Application.ScreenUpdating = True
    End Sub

  6. #6
    Forum Expert
    Join Date
    12-24-2007
    Location
    Alsace - France
    MS-Off Ver
    MS 365 Office Suite
    Posts
    5,066

    Re: Copying Titles Down

    To avoid any confusion can you send a sample with the result you expect in the second column
    Note: You have to use code tags when posting code
    You can try perhaps next statement: "A" changed to "B"
    Please Login or Register  to view this content.
    Last edited by PCI; 11-18-2013 at 01:26 PM.

  7. #7
    Registered User
    Join Date
    10-24-2012
    Location
    Cleveland, OH
    MS-Off Ver
    Excel 2010
    Posts
    44

    Re: Copying Titles Down

    Thanks. Here is the example of what I want it to do. The above code works really well for my titles in column A. Now I want the same thing to happen for different titles in column C. Can you help me figure out the changes I need to make in the macro for it work?
    Attached Files Attached Files

  8. #8
    Forum Expert
    Join Date
    12-24-2007
    Location
    Alsace - France
    MS-Off Ver
    MS 365 Office Suite
    Posts
    5,066

    Re: Copying Titles Down

    Try
    Please Login or Register  to view this content.

  9. #9
    Registered User
    Join Date
    10-24-2012
    Location
    Cleveland, OH
    MS-Off Ver
    Excel 2010
    Posts
    44

    Re: Copying Titles Down

    Thanks that worked perfectly!

+ 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. Copying Cell Titles
    By Orthodoxyn in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 07-31-2013, 11:59 AM
  2. Copying a dataset multiple times - and selecting titles for this dataset
    By alocke in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 02-07-2012, 10:15 PM
  3. Replies: 4
    Last Post: 06-22-2011, 09:50 AM
  4. Formulas in Chart Titles & Axis Titles
    By Bobbbo in forum Excel General
    Replies: 1
    Last Post: 05-20-2010, 02:02 PM
  5. [SOLVED] Titles
    By Troy in forum Excel General
    Replies: 4
    Last Post: 01-31-2006, 10:45 AM

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