+ Reply to Thread
Results 1 to 1 of 1

Thread: Adding Refence numbers to end of cells in multi col range

  1. #1
    Registered User
    Join Date
    09-23-2010
    Location
    Australia
    MS-Off Ver
    Excel 2003
    Posts
    27

    Adding Refence numbers to end of cells in multi col range

    im really hoping someone can help me with this problem.

    im looking for a macro i can run that will add the parentID to the end of the cell contents

    i have included an exmple sheet and sheet 2 of the work book has an example of what the finished product should look like.

    As the woorkbook i am working on has over 6000 rows this is not something i want to go and do manually.

    any help would be greatly appreciated.


    EDIT: Hey thanks to anyone that looked at this problem but i solved it my self it may not be elegant but it works.

    for thos interested in how i did the code is as follws

    Public Sub insertParent()
        Dim rCell As Range
        Dim cNum As Long
        Dim cColOffset As Long
        For Each rCell In Range("C3:F7000")
            cColOffset = rCell.Column - 1
            If Not IsEmpty(rCell) And Not IsNumeric(rCell) Then
                If IsEmpty(rCell.Offset(-1, 0)) And Not IsEmpty(rCell.Offset(-1, -1)) Then
                    cNum = rCell.Offset(-1, -cColOffset).Value
                    rCell.Value = rCell.Value & ", " & cNum
                Else
                    rCell.Value = rCell.Value & ", " & cNum
                End If
            End If
        Next rCell
    End Sub
    Attached Files Attached Files
    Last edited by Aussiexile; 11-19-2010 at 12:44 AM.

+ Reply to Thread

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.2.0