Results 1 to 5 of 5

Macro to combine and return values

Threaded View

  1. #1
    Registered User
    Join Date
    08-22-2012
    Location
    Tokyo
    MS-Off Ver
    Excel 2003
    Posts
    10

    Macro to combine and return values

    Hello everyone,

    I am very new to this and would like some help with a code.

    I have attached the sample workbook, and I am pasting the code I have made so far below.

    However, I have no idea of how to code the next part.

    Basically I want the macro to return this value in cells E2:E11:
    「(value in Data Processing!F2) + "\" + (Value in RC[-1]) + ".jpg"」
    But only if the previous cell contains value.

    Please give me your advice & solutions!

    SAMPLE.xlsx

    Code I have:

    Sheets("Data Processing").Select
        Range("B3:D12").Select
        Selection.COPY
        Sheets("Result").Select
        Range("A2").Select
        ActiveSheet.Paste
        
        Sheets("Data Processing").Select
        Range("B3:B12").Select
        Selection.COPY
        Sheets("Result").Select
        Range("D2").Select
        ActiveSheet.Paste
        
        Dim cell As Range
    
        For Each cell In Range("C2:C12")
        
            If cell.Value <> "" Then
    
                cell.Value = Left(cell.Text, 4) & "." & Val(Mid(cell.Text, 5, 2)) & "." & Val(Mid(cell.Text, 7, 2))
            End If
        
        Next cell
    Last edited by Cutter; 08-24-2012 at 10:49 AM. Reason: Added code tags

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