Close

Results 1 to 3 of 3

Thread: Excel Help

  1. #1
    DF VIP Member Conkers's Avatar
    Join Date
    Jun 2001
    Location
    Out Here !
    Posts
    2,060
    Thanks
    62
    Thanked:        157
    Karma Level
    449

    Help Excel Help

    In the attatched worksheet I wish to make a new column (column D) of the 1st 2 columns combined. Pretty simple.

    My problem is that the 2nd column isn't always populated and in this case it should take the last populated data and use that...


    Is this possible ??
    Attached Files Attached Files

  2. #2
    DF VIP Member cassy34's Avatar
    Join Date
    Nov 2004
    Location
    Lytham
    Posts
    1,453
    Thanks
    246
    Thanked:        181
    Karma Level
    360

    Default Re: Excel Help

    Hi Conkers.

    This is looking like a User Defined Function. Open up a VB Editor window (Alt + F11) and the select Insert > Module. Copy the following code into the module window

    Code:
    Function GetCombined(cell As Range) As String
      'Lists the Hyperlink Address for a Given Cell
      'If cell does not contain a hyperlink, return default_value
      
      Dim FullCell As String
      Dim Row As Integer
      Row = cell.Row
      FullCell = Range("C" & CStr(Row)).Value
      
      Do Until FullCell <> ""
        Row = Row - 1
        FullCell = Range("C" & CStr(Row)).Value
      Loop
    
      GetCombined = Range("B" & cell.Row).Value & Range("C" & CStr(Row)).Value
      
    
    End Function
    Now, in the D3, enter =GetCombined(D3) and copy it down as far as you need. That should do the trick. It's all hard-coded so if you insert/delete columns, it will all go to shit, but hey, it's hometime.

  3. #3
    DF VIP Member Conkers's Avatar
    Join Date
    Jun 2001
    Location
    Out Here !
    Posts
    2,060
    Thanks
    62
    Thanked:        157
    Karma Level
    449

    Default Re: Excel Help

    Thats the ticket... thanks very much!

Similar Threads

  1. excel for fee
    By bobbobb in forum Programming
    Replies: 8
    Last Post: 7th March 2005, 11:22 PM
  2. MS Excel Help Required
    By Speedlock in forum PC Problems
    Replies: 8
    Last Post: 10th August 2003, 08:23 PM
  3. Anyone any good at Excel?
    By Gel in forum The Dog and Duck
    Replies: 3
    Last Post: 18th May 2003, 03:18 PM
  4. upper in excel
    By ceasar in forum PC Software
    Replies: 2
    Last Post: 29th March 2003, 02:02 PM
  5. Excel graph problem
    By marktb in forum PC Problems
    Replies: 2
    Last Post: 9th October 2002, 04:42 PM

Social Networking 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
  •