Results 1 to 2 of 2

Macro to pull info from 2 cells and provide output in third cell

Threaded View

  1. #1
    Registered User
    Join Date
    04-19-2011
    Location
    Australia
    MS-Off Ver
    Excel 2003
    Posts
    1

    Macro to pull info from 2 cells and provide output in third cell

    Hello

    I am trying to write a macro that will do the following

    1. Copy info from cell G11 to F11
    2. Capitalise first letter
    3. Add 'space' (char to end of copied data
    4. Copy info from cell I11 to end of data in cell F11
    5. add ) to end of data.

    This needs to be able to be done on an entire spreadsheet of over 4000 lines.

    You can see this from the attached picture.

    This is what I have come up with so far.

    It will only use the data from the absolute fields and not work with other fields down the spreadsheet.

    I know it needs relative data, but in VB I do not know how to do this.

    Can anyone please help?

    Sub Merge()
    '
    ' Merge Macro
    ' Macro recorded 20/04/2011 by Owner
    '
    
    '
        ActiveCell.Offset(0, 1).Range("$A1").Select
        Selection.Copy
        ActiveCell.Offset(0, -1).Range("$A1").Select
        ActiveSheet.Paste
        Application.CutCopyMode = False
        ActiveCell.FormulaR1C1 = "Line 1 (char "
        ActiveCell.Offset(0, 3).Range("$A1").Select
        ActiveCell.FormulaR1C1 = "26"
        ActiveCell.Offset(0, -3).Range("$A1").Select
        ActiveCell.FormulaR1C1 = "Line 1 (char 26)"
        ActiveCell.Offset(1, 0).Range("$A1").Select
    End Sub
    Attached Images Attached Images

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